1
0
mirror of synced 2025-01-17 22:11:41 +03:00

Nesting level too deep because using in_array, fixed

This commit is contained in:
jackbravo 2007-08-24 19:20:06 +00:00
parent b01212e2e8
commit 666e2f3f8d

View File

@ -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;
}