From 26bd71c170450bbd3d75dc003c597cc8508d7a4b Mon Sep 17 00:00:00 2001 From: Jeroen <4200784+JeroenMoonen@users.noreply.github.com> Date: Fri, 17 May 2024 16:14:52 +0200 Subject: [PATCH 1/2] [docs] Change `annotation` to `attribute` --- docs/configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index b15950da..bea0a0bf 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -738,7 +738,7 @@ configuration for the ORM and there are several configuration options that you can control. The following configuration options exist for a mapping: ``type`` - One of ``annotation``, ``xml``, ``yml``, ``php`` or ``staticphp``. + One of ``attribute``, ``xml``, ``yml``, ``php`` or ``staticphp``. This specifies which type of metadata type your mapping uses. ``dir`` From 17f6cb3c04cdfea5c236dc8ba88d75f997a81ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Sun, 1 Sep 2024 11:37:46 +0200 Subject: [PATCH 2/2] Update rest of the annotation mentions in docs to attributes --- docs/custom-id-generators.rst | 12 +++++------- docs/entity-listeners.rst | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/custom-id-generators.rst b/docs/custom-id-generators.rst index 4c6141ef..11de3d76 100644 --- a/docs/custom-id-generators.rst +++ b/docs/custom-id-generators.rst @@ -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. @@ -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; // .... diff --git a/docs/entity-listeners.rst b/docs/entity-listeners.rst index e08c7b34..35c4483e 100644 --- a/docs/entity-listeners.rst +++ b/docs/entity-listeners.rst @@ -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.