mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 14:16:39 +02:00
- DibiTable::insert() returns NULL when $primaryAutoIncrement is FALSE
This commit is contained in:
@@ -46,6 +46,9 @@ abstract class DibiTable extends /*Nette::*/Object
|
|||||||
/** @var string primary key type */
|
/** @var string primary key type */
|
||||||
protected $primaryModifier = '%i';
|
protected $primaryModifier = '%i';
|
||||||
|
|
||||||
|
/** @var bool primary key is auto increment */
|
||||||
|
protected $primaryAutoIncrement = TRUE;
|
||||||
|
|
||||||
/** @var array */
|
/** @var array */
|
||||||
protected $blankRow = array();
|
protected $blankRow = array();
|
||||||
|
|
||||||
@@ -140,7 +143,7 @@ abstract class DibiTable extends /*Nette::*/Object
|
|||||||
'INSERT INTO %n', $this->name, '%v', $this->prepare($data)
|
'INSERT INTO %n', $this->name, '%v', $this->prepare($data)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($this->primary) {
|
if ($this->primaryAutoIncrement) {
|
||||||
return $this->connection->insertId();
|
return $this->connection->insertId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user