From 779327a60274c8753d17872c566ec2d649b564f9 Mon Sep 17 00:00:00 2001 From: Craig Rayner Date: Tue, 29 May 2018 16:55:47 +1000 Subject: [PATCH 1/4] Update entity-listeners.rst A couple of hours reading various notes and request for help resulted in these changes to the documentation. Hopefully this will help reduce the time needed to get this feature working for the next person. Craig. --- Resources/doc/entity-listeners.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Resources/doc/entity-listeners.rst b/Resources/doc/entity-listeners.rst index 13faf23a8..6c1ca0102 100644 --- a/Resources/doc/entity-listeners.rst +++ b/Resources/doc/entity-listeners.rst @@ -3,8 +3,8 @@ Entity Listeners Entity listeners that are services must be registered with the entity listener resolver. You can tag your entity listeners and they will automatically -be added to the resolver. Use the entity_manager attribute to specify which -entity manager it should be registered with. Example: +be added to the resolver. Compulsory attributes are 'name, event and entity.' Use the +entity_manager attribute to specify which entity manager it should be registered with. Example: .. configuration-block:: @@ -14,8 +14,8 @@ entity manager it should be registered with. Example: user_listener: class: \UserListener tags: - - { name: doctrine.orm.entity_listener } - - { name: doctrine.orm.entity_listener, entity_manager: custom } + - { name: doctrine.orm.entity_listener, event: preUpdate, entity: App\Entity\User } + - { name: doctrine.orm.entity_listener, event: preUpdate, entity: App\Entity\User, entity_manager: custom } .. code-block:: xml @@ -26,8 +26,8 @@ entity manager it should be registered with. Example: - - + + @@ -50,5 +50,5 @@ If you use a version of doctrine/orm < 2.5 you have to register the entity liste // .... } -See also http://doctrine-orm.readthedocs.org/en/latest/reference/events.html#entity-listeners for more info on entity listeners. +See also http://doctrine-orm.readthedocs.org/en/latest/reference/events.html#entity-listeners for more info on entity listeners and the resolver required by Symfony. From db734310692c103ca6572823408da241956aafc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 31 Oct 2018 08:58:33 +1100 Subject: [PATCH 2/4] Change Yaml Spacing for personal preference Co-Authored-By: crayner --- Resources/doc/entity-listeners.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Resources/doc/entity-listeners.rst b/Resources/doc/entity-listeners.rst index 6c1ca0102..326e7c56e 100644 --- a/Resources/doc/entity-listeners.rst +++ b/Resources/doc/entity-listeners.rst @@ -15,7 +15,11 @@ entity_manager attribute to specify which entity manager it should be registered class: \UserListener tags: - { name: doctrine.orm.entity_listener, event: preUpdate, entity: App\Entity\User } - - { name: doctrine.orm.entity_listener, event: preUpdate, entity: App\Entity\User, entity_manager: custom } + - + name: doctrine.orm.entity_listener + event: preUpdate + entity: App\Entity\User + entity_manager: custom .. code-block:: xml From a3b0bed504c8877a36f940c5a3a9a9cdfc6200f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 31 Oct 2018 08:59:25 +1100 Subject: [PATCH 3/4] apply xml format add all options and person preference Co-Authored-By: crayner --- Resources/doc/entity-listeners.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Resources/doc/entity-listeners.rst b/Resources/doc/entity-listeners.rst index 326e7c56e..d029dd326 100644 --- a/Resources/doc/entity-listeners.rst +++ b/Resources/doc/entity-listeners.rst @@ -31,7 +31,12 @@ entity_manager attribute to specify which entity manager it should be registered - + From 21a96cf6c83731383232eb2007caf78cae4c9a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 31 Oct 2018 08:59:53 +1100 Subject: [PATCH 4/4] Personal preference spacing Co-Authored-By: crayner --- Resources/doc/entity-listeners.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Resources/doc/entity-listeners.rst b/Resources/doc/entity-listeners.rst index d029dd326..876112943 100644 --- a/Resources/doc/entity-listeners.rst +++ b/Resources/doc/entity-listeners.rst @@ -59,5 +59,7 @@ If you use a version of doctrine/orm < 2.5 you have to register the entity liste // .... } -See also http://doctrine-orm.readthedocs.org/en/latest/reference/events.html#entity-listeners for more info on entity listeners and the resolver required by Symfony. +See also +http://doctrine-orm.readthedocs.org/en/latest/reference/events.html#entity-listeners +for more info on entity listeners and the resolver required by Symfony.