Added documentation for preMove and postMove events #20
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,8 @@ the life-time of their registered documents. | |
- preFlush - occurs at the very beginning of a flush operation. This event is not a lifecycle callback. | ||
- onFlush - occurs after the change-sets of all managed documents have been computed. This event is not a lifecycle | ||
callback. | ||
- preMove - occurs before a document is moved to the target path | ||
- postMove - occurs after a document has been moved to the target path | ||
|
||
.. note:: | ||
|
||
|
@@ -37,6 +39,10 @@ the life-time of their registered documents. | |
See the `Documentation of DoctrinePHPCRBundle <http://github.com/doctrine/DoctrinePHPCRBundle>`_ | ||
for more information. | ||
|
||
.. note:: | ||
|
||
When I move a document, the document is not be modified, except the ID. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we reformulate that to |
||
The preFlush and onFlush events may modify the document before moving the document. | ||
|
||
.. warning:: | ||
|
||
|
@@ -144,3 +150,15 @@ Listening to Lifecycle Events | |
----------------------------- | ||
|
||
This works exactly the same as with the `ORM events <http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html>`_. | ||
|
||
Persistance event order | ||
----------------------- | ||
|
||
When $dm->flush is calling after $dm->move(), the order of events is: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the generic event order no? i.e. events will happen in this order and it doesn't matter which method you call, so I think something like "Events are fired in the following order when you call |
||
|
||
1. preFlush | ||
2. onFlush | ||
3. preMove | ||
4. postMove | ||
5. postFlush | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would use a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok I updated this document |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please tell that this happens during persisting the move (it does, right? so when caling $dm->flush, not when calling $dm->move?) and please explain in which order the events occur (preFlush preMove postMove onFlush ? )