Skip to content

Commit

Permalink
Update rest of the annotation mentions in docs to attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
ostrolucky committed Sep 1, 2024
1 parent 26bd71c commit 17f6cb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions docs/custom-id-generators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and implement the custom logic in the ``generate(EntityManager $em, $entity)``
method. Before Doctrine bundle 2.3, custom ID generators were always created
without any constructor arguments.

Starting with Doctrine bundle 2.3, the ``CustomIdGenerator`` annotation can be
Starting with Doctrine bundle 2.3, the ``CustomIdGenerator`` attribute can be
used to reference any services tagged with the ``doctrine.id_generator`` tag.
If you enable autoconfiguration (which is the default most of the time), Symfony
will add this tag for you automatically if you implement your own id-generators.
Expand All @@ -28,12 +28,10 @@ are provided: ``doctrine.ulid_generator`` to generate ULIDs, and
*/
class User
{
/**
* @Id
* @Column(type="uuid")
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator("doctrine.uuid_generator")
*/
#[ORM\Id]
#[ORM\Column(type: 'uuid')]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator('doctrine.uuid_generator')]
private $id;
// ....
Expand Down
2 changes: 1 addition & 1 deletion docs/entity-listeners.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Entity Listeners
================

Entity listeners that are services must be registered with the entity listener
resolver. On top of the annotation in the entity class, you have to tag the
resolver. On top of the annotation/attribute in the entity class, you have to tag the
service with ``doctrine.orm.entity_listener`` for it to be automatically added
to the resolver. Use the (optional) ``entity_manager`` attribute to specify
which entity manager it should be registered with.
Expand Down

0 comments on commit 17f6cb3

Please sign in to comment.