@@ -16,9 +16,17 @@ whenever an object in your database is saved.
1616
1717Doctrine defines two types of objects that can listen to Doctrine events:
1818listeners and subscribers. Both are very similar, but listeners are a bit
19- more straightforward. For more, see `The Event System `_ on Doctrine's website .
19+ more straightforward. For more, see `The Event System `_ on Doctrine's documentation .
2020
21- The Doctrine website also explains all existing events that can be listened to.
21+ Before using them, keep in mind that Doctrine events are intended for
22+ persistence hooks (i.e. *"save also this when saving that" *). They should not be
23+ used for domain logic, such as logging changes, setting ``updatedAt `` and
24+ ``createdAt `` properties, etc.
25+
26+ .. seealso ::
27+
28+ This article covers listeners and subscribers for Doctrine ORM. If you are
29+ using ODM for MongoDB, read the `DoctrineMongoDBBundle documentation `_.
2230
2331Configuring the Listener/Subscriber
2432-----------------------------------
@@ -85,11 +93,6 @@ managers that use this connection.
8593 ->addTag('doctrine.event_subscriber', ['connection' => 'default'])
8694 ;
8795
88- .. tip ::
89-
90- If you're using Doctrine with MongoDB, you should use ``doctrine_mongodb.odm.event_listener ``
91- as the tag name for the event listener service.
92-
9396 Creating the Listener Class
9497---------------------------
9598
@@ -302,3 +305,4 @@ numbers mean that listeners are invoked earlier.
302305
303306 .. _`The Event System` : http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html
304307.. _`the DoctrineBundle documentation` : https://symfony.com/doc/current/bundles/DoctrineBundle/entity-listeners.html
308+ .. _`DoctrineMongoDBBundle documentation` : https://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html
0 commit comments