From 0a2d19041291d7c0e5c80301d5500d6e04860cdc Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Thu, 3 Aug 2023 15:41:20 +0200 Subject: [PATCH] Emit `postFlush` events as the very last thing in `UoW::flush()` --- lib/Doctrine/ORM/UnitOfWork.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index f9b8cf2b892..5a4e47bdf39 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -402,9 +402,8 @@ public function commit($entity = null) $this->orphanRemovals) ) { $this->dispatchOnFlushEvent(); - $this->dispatchPostFlushEvent(); - $this->postCommitCleanup($entity); + $this->dispatchPostFlushEvent(); return; // Nothing to do. } @@ -499,9 +498,9 @@ public function commit($entity = null) $coll->takeSnapshot(); } - $this->dispatchPostFlushEvent(); - $this->postCommitCleanup($entity); + + $this->dispatchPostFlushEvent(); } /** @param object|object[]|null $entity */