Skip to content

Changed the title of a Doctrine article to avoid confusion #8604

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

Merged
merged 1 commit into from
Nov 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions doctrine/event_listeners_subscribers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
single: Doctrine; Event listeners and subscribers

.. _doctrine-event-config:
.. _how-to-register-event-listeners-and-subscribers:

How to Register Event Listeners and Subscribers
===============================================
Doctrine Event Listeners and Subscribers
========================================

Doctrine packages have a rich event system that fires events when almost anything
happens inside the system. For you, this means that you can create arbitrary
Expand Down Expand Up @@ -217,15 +218,15 @@ For a full reference, see chapter `The Event System`_ in the Doctrine documentat
Lazy loading for Event Listeners
--------------------------------

One subtle difference between listeners and subscribers is that Symfony can load
One subtle difference between listeners and subscribers is that Symfony can load
entity listeners lazily. This means that your listener class will only be fetched
from the service container (and thus be instantiated) once the event it is linked
to actually fires.

Lazy loading might give you a slight performance improvement when your listener
runs for events that rarely fire. Also, it can help you when you run into
Lazy loading might give you a slight performance improvement when your listener
runs for events that rarely fire. Also, it can help you when you run into
*circular dependency issues* that may occur when your listener service in turn
depends on the DBAL connection.
depends on the DBAL connection.

To mark a listener service as lazily loaded, just add the ``lazy`` attribute
to the tag like so:
Expand Down