You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a small library and found myself in need of the entity that is being flushed within the preFlush event. This should be part of the PreFlushEventArgs object in my opinion.
<?php
// UnitOfWork.php
// ...
public function commit($entity = null)
{
// Raise preFlush
if ($this->evm->hasListeners(Events::preFlush)) {
$this->evm->dispatchEvent(Events::preFlush, new PreFlushEventArgs($this->em, $entity));
}
// ...
Any thoughts on this?
The text was updated successfully, but these errors were encountered:
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).
Yes it does occur before but the commit function "knows" whether a specific or any altered entity should be updated. Unfortunately i cannot use the onFlush event as my library does some preprocessing before any change-sets are calculated.
It just seems that the preFlush event should be aware of the $entity argument 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.
I'm working on a small library and found myself in need of the entity that is being flushed within the
preFlush
event. This should be part of thePreFlushEventArgs
object in my opinion.Any thoughts on this?
The text was updated successfully, but these errors were encountered: