From 0ff176cd2622279c9900b508fd084d76426fe92d Mon Sep 17 00:00:00 2001 From: Patrick McCarren Date: Sun, 31 Aug 2014 22:01:14 -0400 Subject: [PATCH] Delete objects in the reverse as they were created --- src/Factory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Factory.php b/src/Factory.php index cace74b..7701551 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -502,7 +502,7 @@ public function isPendingOrSaved($object) public function deleteSaved() { $exceptions = array(); - foreach ($this->saved as $object) { + foreach (array_reverse($this->saved) as $object) { try { if (!$this->delete($object)) { throw new DeleteFailedException(get_class($object));