mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
preFlush: PreFlushEventArgs should contain the entity being flushed #5267
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 @andreas-glaser on GitHub (Sep 21, 2016).
Originally assigned to: @Ocramius on GitHub.
I'm working on a small library and found myself in need of the entity that is being flushed within the
preFlushevent. This should be part of thePreFlushEventArgsobject in my opinion.Any thoughts on this?
@coudenysj commented on GitHub (Sep 27, 2016):
The preFlush event occurs before the changes are computed in the UnitOfWork. At this point, the UnitOfWork is not aware which entities should be flushed (the $entity parameter is optional).
Cant you use the onFlush event?
@andreas-glaser commented on GitHub (Sep 27, 2016):
Yes it does occur before but the
commitfunction "knows" whether a specific or any altered entity should be updated. Unfortunately i cannot use theonFlushevent as my library does some preprocessing before any change-sets are calculated.It just seems that the
preFlushevent should be aware of the$entityargument being passed into the method. I mean without it there is very little use for the event... or at least I cannot think of any uses.https://github.com/andreas-glaser/dc-event-bundle/tree/1.1
@linaori commented on GitHub (Oct 2, 2016):
see #5848
@Ocramius commented on GitHub (Oct 2, 2016):
Closing as duplicate.