summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
authorLuis Ramón López <[email protected]>2014-09-20 20:13:42 +0200
committerLuis Ramón López <[email protected]>2014-09-20 20:21:07 +0200
commit2ff8cd553598ae6fd0f516696489b4552068255d (patch)
tree1f3db3ffc62f275b45adab75167d3332beb5ab8d /idiorm.php
parent22b1d3a793ed486c816d24fc25dce960797d1f38 (diff)
Fix autoincremented compound keys inserts
When inserting new records on a autoincremented compound keys table, a bug would prevent updating the autoincremented value. Fixes #233
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/idiorm.php b/idiorm.php
index 0e305fd..39eaabd 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -2027,7 +2027,7 @@
// if the primary key is compound, assign the last inserted id
// to the first column
if (is_array($column)) {
- $column = array_slice($column, 0, 1);
+ $column = reset($column);
}
$this->_data[$column] = $db->lastInsertId();
}