From 8a168bb2ceba38ea591c7818916d02feaa48bd9a Mon Sep 17 00:00:00 2001 From: Zacharias Luiten Date: Tue, 25 Feb 2014 14:00:33 +0100 Subject: [PATCH] stop executing executeDeletions when there is nothing to to delete anymore --- lib/Doctrine/ORM/UnitOfWork.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index a61630d1f6a..527df55c466 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -373,7 +373,7 @@ public function commit($entity = null) // Entity deletions come last and need to be in reverse commit order if ($this->entityDeletions) { - for ($count = count($commitOrder), $i = $count - 1; $i >= 0; --$i) { + for ($count = count($commitOrder), $i = $count - 1; $i >= 0 && $this->entityDeletions; --$i) { $this->executeDeletions($commitOrder[$i]); } }