1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Clearer fix for nesting level too deep bug, use in_array with strict flag (use === instead of ==)

This commit is contained in:
jackbravo 2007-08-24 21:43:50 +00:00
parent 666e2f3f8d
commit 17913f5860
2 changed files with 6 additions and 11 deletions

View File

@ -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)

View File

@ -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 ?) return false;
*
* if used it results in fatal error : [ nesting level too deep ]
*/
foreach ($this->invalid as $val) {
if ($val === $record) {
return false;
}
} }
$this->invalid[] = $record; $this->invalid[] = $record;
return true; return true;
} }