1
0
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:
David Grudl
2008-07-24 16:34:00 +00:00
parent 97f2ed392f
commit c438b72972

View File

@@ -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();
} }
} }