public onFlush ( Doctrine\ORM\Event\OnFlushEventArgs $eventArgs ) | ||
$eventArgs | Doctrine\ORM\Event\OnFlushEventArgs | The event arguments as given by Doctrine |
public function onFlush(OnFlushEventArgs $eventArgs)
{
$entityManager = $eventArgs->getEntityManager();
$uow = $entityManager->getUnitOfWork();
foreach ($uow->getScheduledEntityInsertions() as $updated) {
if ($updated instanceof PartCategory) {
$this->updateCategoryPaths($updated, $eventArgs);
}
}
foreach ($uow->getScheduledEntityUpdates() as $updated) {
if ($updated instanceof PartCategory) {
$this->updateCategoryPaths($updated, $eventArgs);
}
}
}