@@ -153,6 +153,7 @@ with the ``doctrine.event_listener`` tag:
153
153
154
154
.. code-block :: yaml
155
155
156
+ # config/services.yaml
156
157
services :
157
158
# ...
158
159
@@ -172,6 +173,7 @@ with the ``doctrine.event_listener`` tag:
172
173
173
174
.. code-block :: xml
174
175
176
+ <!-- config/services.xml -->
175
177
<?xml version =" 1.0" ?>
176
178
<container xmlns =" http://symfony.com/schema/dic/services"
177
179
xmlns : doctrine =" http://symfony.com/schema/dic/doctrine" >
@@ -195,6 +197,7 @@ with the ``doctrine.event_listener`` tag:
195
197
196
198
.. code-block :: php
197
199
200
+ // config/services.php
198
201
use App\EventListener\SearchIndexer;
199
202
200
203
// listeners are applied by default to all Doctrine connections
@@ -250,6 +253,7 @@ with the ``doctrine.orm.entity_listener`` tag:
250
253
251
254
.. code-block :: yaml
252
255
256
+ # config/services.yaml
253
257
services :
254
258
# ...
255
259
@@ -274,6 +278,7 @@ with the ``doctrine.orm.entity_listener`` tag:
274
278
275
279
.. code-block :: xml
276
280
281
+ <!-- config/services.xml -->
277
282
<?xml version =" 1.0" ?>
278
283
<container xmlns =" http://symfony.com/schema/dic/services"
279
284
xmlns : doctrine =" http://symfony.com/schema/dic/doctrine" >
@@ -302,6 +307,7 @@ with the ``doctrine.orm.entity_listener`` tag:
302
307
303
308
.. code-block :: php
304
309
310
+ // config/services.php
305
311
use App\Entity\User;
306
312
use App\EventListener\UserChangedNotifier;
307
313
@@ -394,6 +400,7 @@ with the ``doctrine.event_subscriber`` tag:
394
400
395
401
.. code-block :: yaml
396
402
403
+ # config/services.yaml
397
404
services :
398
405
# ...
399
406
@@ -403,6 +410,7 @@ with the ``doctrine.event_subscriber`` tag:
403
410
404
411
.. code-block :: xml
405
412
413
+ <!-- config/services.xml -->
406
414
<?xml version =" 1.0" ?>
407
415
<container xmlns =" http://symfony.com/schema/dic/services"
408
416
xmlns : doctrine =" http://symfony.com/schema/dic/doctrine" >
@@ -417,6 +425,7 @@ with the ``doctrine.event_subscriber`` tag:
417
425
418
426
.. code-block :: php
419
427
428
+ // config/services.php
420
429
use App\EventListener\DatabaseActivitySubscriber;
421
430
422
431
$container->autowire(DatabaseActivitySubscriber::class)
@@ -430,6 +439,7 @@ can do it in the service configuration:
430
439
431
440
.. code-block :: yaml
432
441
442
+ # config/services.yaml
433
443
services :
434
444
# ...
435
445
@@ -439,6 +449,7 @@ can do it in the service configuration:
439
449
440
450
.. code-block :: xml
441
451
452
+ <!-- config/services.xml -->
442
453
<?xml version =" 1.0" ?>
443
454
<container xmlns =" http://symfony.com/schema/dic/services"
444
455
xmlns : doctrine =" http://symfony.com/schema/dic/doctrine" >
@@ -453,6 +464,7 @@ can do it in the service configuration:
453
464
454
465
.. code-block :: php
455
466
467
+ // config/services.php
456
468
use App\EventListener\DatabaseActivitySubscriber;
457
469
458
470
$container->autowire(DatabaseActivitySubscriber::class)
0 commit comments