1
0
mirror of synced 2025-01-20 15:31:40 +03:00
This commit is contained in:
zYne 2007-01-28 23:55:30 +00:00
parent 13783ed267
commit 278bafbc93

View File

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