mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
postPersist event not fired for scheduled insertions if unity of work also includes scheduled updates #5251
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jwmwalrus on GitHub (Sep 12, 2016).
Hi,
The postPersist event is not invoked for insertions (i.e., new entities), if the set of changes to be flushed includes pre-existing entities being updated. For example, the following does not invoke the postPersist event for the Invoice entity:
The postPersist event is only invoked by rearranging lines, as in:
It looks to me like a bug ---or at the very least, a limitation, since it forces the developer to flush things in a certain order.
Is that the expected/intented behavior?
@jwmwalrus commented on GitHub (Nov 16, 2016):
I apologize in advance if I'm bothering too much, but...
Any comments regarding this issue? Is it a bug, a limitation, a feature?
@lcobucci commented on GitHub (Nov 16, 2016):
@jwmwalrus can you try reproducing it against
05e77868ab/tests/Doctrine/Tests/ORM/Functional/Ticketplease? (see that dir for examples)