@@ -134,38 +134,38 @@ see :ref:`lifecycle-callbacks`
134134Events Overview
135135---------------
136136
137- +-----------------------------+-----------------------+-----------+
138- | Event | Dispatched by | Lifecycle |
139- | | | Callback |
140- +=============================+=======================+===========+
141- | `` preRemove `` | ``$em->remove() `` | Yes |
142- +-----------------------------+-----------------------+-----------+
143- | `` postRemove `` | ``$em->flush() `` | Yes |
144- +-----------------------------+-----------------------+-----------+
145- | `` prePersist `` | ``$em->persist() `` | Yes |
146- | | on *initial * persist | |
147- +-----------------------------+-----------------------+-----------+
148- | `` postPersist `` | ``$em->flush() `` | Yes |
149- +-----------------------------+-----------------------+-----------+
150- | `` preUpdate `` | ``$em->flush() `` | Yes |
151- +-----------------------------+-----------------------+-----------+
152- | `` postUpdate `` | ``$em->flush() `` | Yes |
153- +-----------------------------+-----------------------+-----------+
154- | `` postLoad `` | Loading from database | Yes |
155- +-----------------------------+-----------------------+-----------+
156- | `` loadClassMetadata `` | Loading of mapping | No |
157- | | metadata | |
158- +-----------------------------+-----------------------+-----------+
159- | ``onClassMetadataNotFound `` | ``MappingException `` | No |
160- +-----------------------------+-----------------------+-----------+
161- | `` preFlush `` | ``$em->flush() `` | Yes |
162- +-----------------------------+-----------------------+-----------+
163- | `` onFlush `` | ``$em->flush() `` | No |
164- +-----------------------------+-----------------------+-----------+
165- | `` postFlush `` | ``$em->flush() `` | No |
166- +-----------------------------+-----------------------+-----------+
167- | ``onClear `` | ``$em->clear() `` | No |
168- +-----------------------------+-----------------------+-----------+
137+ +----------------------------------------------------------------- +-----------------------+-----------+
138+ | Event | Dispatched by | Lifecycle |
139+ | | | Callback |
140+ +================================================================= +=======================+===========+
141+ | :ref: ` reference-events-pre-remove ` | ``$em->remove() `` | Yes |
142+ +----------------------------------------------------------------- +-----------------------+-----------+
143+ | :ref: ` reference-events-post-update-remove-persist< postRemove> ` | ``$em->flush() `` | Yes |
144+ +----------------------------------------------------------------- +-----------------------+-----------+
145+ | :ref: ` reference-events-pre-persist ` | ``$em->persist() `` | Yes |
146+ | | on *initial * persist | |
147+ +----------------------------------------------------------------- +-----------------------+-----------+
148+ | :ref: ` reference-events-post-update-remove-persist< postPersist> ` | ``$em->flush() `` | Yes |
149+ +----------------------------------------------------------------- +-----------------------+-----------+
150+ | :ref: ` reference-events-pre-update ` | ``$em->flush() `` | Yes |
151+ +----------------------------------------------------------------- +-----------------------+-----------+
152+ | :ref: ` reference-events-post-update-remove-persist< postUpdate> ` | ``$em->flush() `` | Yes |
153+ +----------------------------------------------------------------- +-----------------------+-----------+
154+ | :ref: ` reference-events-post-load ` | Loading from database | Yes |
155+ +----------------------------------------------------------------- +-----------------------+-----------+
156+ | :ref: ` reference-events-load-class-metadata ` | Loading of mapping | No |
157+ | | metadata | |
158+ +----------------------------------------------------------------- +-----------------------+-----------+
159+ | ``onClassMetadataNotFound `` | ``MappingException `` | No |
160+ +----------------------------------------------------------------- +-----------------------+-----------+
161+ | :ref: ` reference-events-pre-flush ` | ``$em->flush() `` | Yes |
162+ +----------------------------------------------------------------- +-----------------------+-----------+
163+ | :ref: ` reference-events-on-flush ` | ``$em->flush() `` | No |
164+ +----------------------------------------------------------------- +-----------------------+-----------+
165+ | :ref: ` reference-events-post-flush ` | ``$em->flush() `` | No |
166+ +----------------------------------------------------------------- +-----------------------+-----------+
167+ | ``onClear `` | ``$em->clear() `` | No |
168+ +----------------------------------------------------------------- +-----------------------+-----------+
169169
170170Naming convention
171171~~~~~~~~~~~~~~~~~
@@ -563,6 +563,8 @@ the restrictions apply as well, with the additional restriction
563563that (prior to version 2.4) you do not have access to the
564564``EntityManager `` or ``UnitOfWork `` APIs inside these events.
565565
566+ .. _reference-events-pre-persist :
567+
566568prePersist
567569~~~~~~~~~~
568570
@@ -588,6 +590,8 @@ The following restrictions apply to ``prePersist``:
588590- Doctrine will not recognize changes made to relations in a prePersist
589591 event. This includes modifications to
590592 collections such as additions, removals or replacement.
593+
594+ .. _reference-events-pre-remove :
591595
592596preRemove
593597~~~~~~~~~
@@ -600,6 +604,8 @@ There are no restrictions to what methods can be called inside the
600604``preRemove `` event, except when the remove method itself was
601605called during a flush operation.
602606
607+ .. _reference-events-pre-flush :
608+
603609preFlush
604610~~~~~~~~
605611
@@ -622,6 +628,8 @@ result in infinite loop.
622628 }
623629 }
624630
631+ .. _reference-events-on-flush :
632+
625633onFlush
626634~~~~~~~
627635
@@ -685,6 +693,8 @@ The following restrictions apply to the onFlush event:
685693 affected entity. This can be done by calling
686694 ``$unitOfWork->recomputeSingleEntityChangeSet($classMetadata, $entity) ``.
687695
696+ .. _reference-events-post-flush :
697+
688698postFlush
689699~~~~~~~~~
690700
@@ -705,6 +715,8 @@ postFlush
705715 }
706716 }
707717
718+ .. _reference-events-pre-update :
719+
708720preUpdate
709721~~~~~~~~~
710722
@@ -789,6 +801,8 @@ Restrictions for this event:
789801 API are strongly discouraged and don't work as expected outside the
790802 flush operation.
791803
804+ .. _reference-events-post-update-remove-persist :
805+
792806postUpdate, postRemove, postPersist
793807~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
794808
@@ -798,6 +812,8 @@ database, but you can use these events to alter non-persistable items,
798812like non-mapped fields, logging or even associated classes that are
799813not directly mapped by Doctrine.
800814
815+ .. _reference-events-post-load :
816+
801817postLoad
802818~~~~~~~~
803819
@@ -1010,6 +1026,8 @@ Implementing your own resolver :
10101026 $configurations->setEntityListenerResolver(new MyEntityListenerResolver);
10111027 EntityManager::create(.., $configurations, ..);
10121028
1029+ .. _reference-events-load-class-metadata :
1030+
10131031Load ClassMetadata Event
10141032------------------------
10151033
0 commit comments