Skip to content

Commit 905ee33

Browse files
Pieter Egginkphansys
authored andcommitted
Add documentation for registering event subscriber and doctrine ODM bundle
1 parent 4447245 commit 905ee33

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/symfony4.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,17 @@ You will need to create this subscriber class if you use **loggable** , **transl
218218
behaviors. This listener will set the **locale used** from request and **username** to
219219
loggable and blameable. So, to finish the setup create **EventSubscriber\DoctrineExtensionSubscriber**
220220

221+
## Register event subscriber for [Symfony Doctrine MongoDB Bundle](https://github.com/doctrine/DoctrineMongoDBBundle)
222+
223+
Because DoctrineExtensions does not implement `EventSubscriberInterface` from MongoDBBundle, you need to manually tag
224+
the listeners. Otherwise, the listeners will not be listening to the triggered events of Doctrine.
225+
226+
```yaml
227+
Gedmo\Loggable\LoggableListener:
228+
tags:
229+
- { name: doctrine_mongodb.odm.event_subscriber }
230+
```
231+
221232
```php
222233
<?php
223234

0 commit comments

Comments
 (0)