From c438b729722bf631b3dcb15305f1e676b084d228 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 24 Jul 2008 16:34:00 +0000 Subject: [PATCH] - DibiTable::insert() returns NULL when $primaryAutoIncrement is FALSE --- dibi/libs/DibiTable.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dibi/libs/DibiTable.php b/dibi/libs/DibiTable.php index 93fe5f83..f6f78034 100644 --- a/dibi/libs/DibiTable.php +++ b/dibi/libs/DibiTable.php @@ -46,6 +46,9 @@ abstract class DibiTable extends /*Nette::*/Object /** @var string primary key type */ protected $primaryModifier = '%i'; + /** @var bool primary key is auto increment */ + protected $primaryAutoIncrement = TRUE; + /** @var array */ protected $blankRow = array(); @@ -140,7 +143,7 @@ abstract class DibiTable extends /*Nette::*/Object 'INSERT INTO %n', $this->name, '%v', $this->prepare($data) ); - if ($this->primary) { + if ($this->primaryAutoIncrement) { return $this->connection->insertId(); } }