Commit 26a723e8 authored by zYne's avatar zYne

fixed identifier quoting for update()

parent 9862f45f
......@@ -259,7 +259,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen
}
$set = array();
foreach ($array as $name => $value) {
$set[] = $name." = ?";
$set[] = $name . ' = ?';
if ($value instanceof Doctrine_Record) {
switch ($value->state()) {
......@@ -269,9 +269,9 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen
default:
$array[$name] = $value->getIncremented();
$record->set($name, $value->getIncremented());
};
}
};
}
}
$params = array_values($array);
$id = $record->obtainIdentifier();
......@@ -282,7 +282,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen
$id = array_values($id);
$params = array_merge($params, $id);
$sql = 'UPDATE ' . $record->getTable()->getTableName()
$sql = 'UPDATE ' . $this->conn->quoteIdentifier($record->getTable()->getTableName())
. ' SET ' . implode(', ', $set)
. ' WHERE ' . implode(' = ? AND ', $record->getTable()->getPrimaryKeys())
. ' = ?';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment