Commit 278bafbc authored by zYne's avatar zYne

--no commit message

--no commit message
parent 13783ed2
...@@ -320,15 +320,18 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen ...@@ -320,15 +320,18 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen
$id = $this->conn->sequence->nextId($seq); $id = $this->conn->sequence->nextId($seq);
$name = $record->getTable()->getIdentifier(); $name = $record->getTable()->getIdentifier();
$array[$name] = $id; $array[$name] = $id;
$record->assignIdentifier($id);
} }
$this->conn->insert($table->getTableName(), $array); $this->conn->insert($table->getTableName(), $array);
if (count($keys) == 1 && $keys[0] == $table->getIdentifier()) { if (empty($seq) && count($keys) == 1 && $keys[0] == $table->getIdentifier()) {
$id = $this->conn->getDBH()->lastInsertID(); $id = $this->conn->sequence->lastInsertId();
if ( ! $id) if ( ! $id) {
$id = $table->getMaxIdentifier(); $id = $table->getMaxIdentifier();
}
$record->assignIdentifier($id); $record->assignIdentifier($id);
} else { } else {
......
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