Skip to content

Commit

Permalink
Merge pull request #962 from netiul/master
Browse files Browse the repository at this point in the history
Stop executeDeletions when there is nothing to to delete anymore
  • Loading branch information
beberlei committed Mar 23, 2014
2 parents dd8075e + 8a168bb commit a03c8da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
Expand Down

0 comments on commit a03c8da

Please sign in to comment.