Clearer fix for nesting level too deep bug, use in_array with strict flag (use === instead of ==)
This commit is contained in:
parent
666e2f3f8d
commit
17913f5860
@ -469,7 +469,10 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// column names are specified as array keys
|
// column names are specified as array keys
|
||||||
$cols = array_keys($values);
|
$cols = array();
|
||||||
|
foreach ($values as $key => $value) {
|
||||||
|
$cols[] = $this->quoteIdentifier($key);
|
||||||
|
}
|
||||||
|
|
||||||
// build the statement
|
// build the statement
|
||||||
$query = 'INSERT INTO ' . $this->quoteIdentifier($table)
|
$query = 'INSERT INTO ' . $this->quoteIdentifier($table)
|
||||||
|
@ -129,17 +129,9 @@ class Doctrine_Transaction extends Doctrine_Connection_Module
|
|||||||
*/
|
*/
|
||||||
public function addInvalid(Doctrine_Record $record)
|
public function addInvalid(Doctrine_Record $record)
|
||||||
{
|
{
|
||||||
/**
|
if (in_array($record, $this->invalid, true)) {
|
||||||
* 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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$this->invalid[] = $record;
|
$this->invalid[] = $record;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user