|
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
|
@@ -217,15 +218,15 @@ For a full reference, see chapter `The Event System`_ in the Doctrine documentat
|
217 | 218 | Lazy loading for Event Listeners
|
218 | 219 | --------------------------------
|
219 | 220 |
|
220 |
| -One subtle difference between listeners and subscribers is that Symfony can load |
| 221 | +One subtle difference between listeners and subscribers is that Symfony can load |
221 | 222 | entity listeners lazily. This means that your listener class will only be fetched
|
222 | 223 | from the service container (and thus be instantiated) once the event it is linked
|
223 | 224 | to actually fires.
|
224 | 225 |
|
225 |
| -Lazy loading might give you a slight performance improvement when your listener |
226 |
| -runs for events that rarely fire. Also, it can help you when you run into |
| 226 | +Lazy loading might give you a slight performance improvement when your listener |
| 227 | +runs for events that rarely fire. Also, it can help you when you run into |
227 | 228 | *circular dependency issues* that may occur when your listener service in turn
|
228 |
| -depends on the DBAL connection. |
| 229 | +depends on the DBAL connection. |
229 | 230 |
|
230 | 231 | To mark a listener service as lazily loaded, just add the ``lazy`` attribute
|
231 | 232 | to the tag like so:
|
|
0 commit comments