|
2 | 2 | single: Doctrine; Event listeners and subscribers
|
3 | 3 |
|
4 | 4 | .. _doctrine-event-config:
|
| 5 | +.. _how-to-register-event-listeners-and-subscribers: |
5 | 6 |
|
6 |
| -How to Register Event Listeners and Subscribers |
7 |
| -=============================================== |
| 7 | +Doctrine Event Listeners and Subscribers |
| 8 | +======================================== |
8 | 9 |
|
9 | 10 | Doctrine packages have a rich event system that fires events when almost anything
|
10 | 11 | happens inside the system. For you, this means that you can create arbitrary
|
@@ -188,15 +189,15 @@ For a full reference, see chapter `The Event System`_ in the Doctrine documentat
|
188 | 189 | Lazy loading for Event Listeners
|
189 | 190 | --------------------------------
|
190 | 191 |
|
191 |
| -One subtle difference between listeners and subscribers is that Symfony can load |
| 192 | +One subtle difference between listeners and subscribers is that Symfony can load |
192 | 193 | entity listeners lazily. This means that your listener class will only be fetched
|
193 | 194 | from the service container (and thus be instantiated) once the event it is linked
|
194 | 195 | to actually fires.
|
195 | 196 |
|
196 |
| -Lazy loading might give you a slight performance improvement when your listener |
197 |
| -runs for events that rarely fire. Also, it can help you when you run into |
| 197 | +Lazy loading might give you a slight performance improvement when your listener |
| 198 | +runs for events that rarely fire. Also, it can help you when you run into |
198 | 199 | *circular dependency issues* that may occur when your listener service in turn
|
199 |
| -depends on the DBAL connection. |
| 200 | +depends on the DBAL connection. |
200 | 201 |
|
201 | 202 | To mark a listener service as lazily loaded, just add the ``lazy`` attribute
|
202 | 203 | to the tag like so:
|
|
0 commit comments