From c93e01e5e7fc3971da31b535d3ad1ad31ccb5bd6 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 8 Nov 2017 13:31:14 +0100 Subject: [PATCH] Changed the title of a Doctrine article to avoid confusion --- doctrine/event_listeners_subscribers.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doctrine/event_listeners_subscribers.rst b/doctrine/event_listeners_subscribers.rst index aaf2db35671..75de3521230 100644 --- a/doctrine/event_listeners_subscribers.rst +++ b/doctrine/event_listeners_subscribers.rst @@ -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 @@ -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: