Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Entity Listener Docs to New Service Style #1161

Merged
merged 2 commits into from May 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 7 additions & 10 deletions Resources/doc/entity-listeners.rst
Expand Up @@ -18,7 +18,7 @@ Full example:

/**
* @ORM\Entity
* @ORM\EntityListeners({"UserListener"})
* @ORM\EntityListeners({"App\UserListener"})
*/
class User
{
Expand All @@ -31,8 +31,7 @@ Full example:
.. code-block:: yaml

services:
user_listener:
class: \UserListener
App\UserListener:
tags:
# Minimal configuration below
- { name: doctrine.orm.entity_listener }
Expand All @@ -46,7 +45,7 @@ Full example:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<services>
<service id="user_listener" class="UserListener">
<service id="App\UserListener">
<!-- entity_manager attribute is optional -->
<tag name="doctrine.orm.entity_listener" entity_manager="custom" />
</service>
Expand All @@ -62,8 +61,7 @@ definition:
.. code-block:: yaml

services:
user_listener:
class: \UserListener
App\UserListener:
tags:
-
name: doctrine.orm.entity_listener
Expand All @@ -81,7 +79,7 @@ definition:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<services>
<service id="user_listener" class="UserListener">
<service id="App\UserListener">
<!-- entity_manager attribute is optional -->
<!-- method attribute is optional -->
<tag
Expand Down Expand Up @@ -116,8 +114,7 @@ are only instantiated when they are actually used.
.. code-block:: yaml

services:
lazy_user_listener:
class: \UserListener
App\UserListener:
tags:
- { name: doctrine.orm.entity_listener, lazy: true }

Expand All @@ -129,7 +126,7 @@ are only instantiated when they are actually used.
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<services>
<service id="lazy_user_listener" class="UserListener">
<service id="App\UserListener">
<tag name="doctrine.orm.entity_listener" event="preUpdate" entity="App\Entity\User" lazy="true" />
</service>
</services>
Expand Down