mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1020: Do we really need PreUpdateEventArgs::_assertValidField()? #1273
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 @doctrinebot on GitHub (Feb 8, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user @jwage:
I am not sure why we need this. I have a situation where we have a preUpdate() listener and the field I want to set the value for is not already in the changeset so _assertValidField() throws an exception. Do we really need this?
@doctrinebot commented on GitHub (Feb 11, 2011):
Comment created by @jwage:
Working on an actual test and patch for this.
@doctrinebot commented on GitHub (Feb 11, 2011):
Comment created by @jwage:
After discussing this we discovered that you just need to modify the entity and then explicitly recompute the changeset for that document.
@doctrinebot commented on GitHub (Feb 11, 2011):
Issue was closed with resolution "Invalid"
@mvorisek commented on GitHub (Jul 10, 2018):
preUpdate
Once all preUpdate listeners are invoked, the UoW::recomputeSingleEntityChangeSet() method is called implicitly.
For deeper analysis read this and see the Doctrine UoW code:
So the UoW::recomputeSingleEntityChangeSet() method needs to be called by the user only if there are more prePersist listeners and the changeSet needs to be the latest for every of them (but keep in mind that the prePersist listeners can be called in any order).
onFlush
Note: for some reasons the UoW::recomputeSingleEntityChangeSet() method is not called after onFlush listeners and invoked so in onFlush listeners it needs to be called manually!