From fa8000fa5c1d8a6d689e0df8b9ab4b8953a048e6 Mon Sep 17 00:00:00 2001 From: Daniel Freudenberger Date: Sun, 23 Oct 2011 01:27:09 +0200 Subject: [PATCH] dispatch the event after the snapshot was taken --- lib/Doctrine/ORM/UnitOfWork.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index e9cddd035..7faaf581e 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -328,17 +328,17 @@ class UnitOfWork implements PropertyChangedListener $conn->rollback(); throw $e; } - - // Raise postFlush - if ($this->evm->hasListeners(Events::postFlush)) { - $this->evm->dispatchEvent(Events::postFlush, new Event\PostFlushEventArgs($this->em)); - } // Take new snapshots from visited collections foreach ($this->visitedCollections as $coll) { $coll->takeSnapshot(); } + // Raise postFlush + if ($this->evm->hasListeners(Events::postFlush)) { + $this->evm->dispatchEvent(Events::postFlush, new Event\PostFlushEventArgs($this->em)); + } + // Clear up $this->entityInsertions = $this->entityUpdates =