DbObject: do not insert id=NULL, fails on pgsql
This commit is contained in:
parent
bea63149c6
commit
6c8213f4db
|
@ -550,7 +550,11 @@ abstract class DbObject
|
|||
*/
|
||||
protected function insertIntoDb()
|
||||
{
|
||||
return $this->db->insert($this->table, $this->getProperties());
|
||||
$properties = $this->getProperties();
|
||||
if ($this->autoincKeyName !== null) {
|
||||
unset($properties[$this->autoincKeyName]);
|
||||
}
|
||||
return $this->db->insert($this->table, $properties);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue