mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Calling computeChangeSets from onUpdate Entity listener #6219
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 @ghost on GitHub (Apr 14, 2019).
Originally assigned to: @Ocramius on GitHub.
Question
Hello, I've got some question about internals of
UnitOfWork.The problem is when I got both Entity lifecycle callback and listener for
onUpdateevent -- if the state of Entity is somehow changed and thenUnitOfWork::computeChangeSets()is called from the listener, I loose all changes except those made by lifecycle callback.Is it wrong to call
computeChangeSets()from Entity listener, and, if not, should not it calculate changesets correctly?To reproduce this (probably bug), I created a repository
I appreciate any response to my problem!
@Ocramius commented on GitHub (Apr 14, 2019):
Yes: please act in
onFlushand userecompute*methods instead.