From 666e2f3f8dcee9ccb036d8a9a5bf59017bf3a2f5 Mon Sep 17 00:00:00 2001 From: jackbravo Date: Fri, 24 Aug 2007 19:20:06 +0000 Subject: [PATCH] Nesting level too deep because using in_array, fixed --- lib/Doctrine/Transaction.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/Transaction.php b/lib/Doctrine/Transaction.php index 997fd85f0..edec8cf96 100644 --- a/lib/Doctrine/Transaction.php +++ b/lib/Doctrine/Transaction.php @@ -129,9 +129,17 @@ class Doctrine_Transaction extends Doctrine_Connection_Module */ public function addInvalid(Doctrine_Record $record) { - if (in_array($record, $this->invalid)) { - return false; + /** + * for some weird reason in_array cannot be used here (php bug ?) + * + * if used it results in fatal error : [ nesting level too deep ] + */ + foreach ($this->invalid as $val) { + if ($val === $record) { + return false; + } } + $this->invalid[] = $record; return true; }