diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2012-04-18 22:06:58 +0200 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2012-04-18 22:06:58 +0200 |
commit | 71ac7e699f587ee479893d16521ea59570bd319f (patch) | |
tree | 0f77529c1c57fa5eb3a89937d2c04636c5e4b75f /system | |
parent | 5e63cd6fa56b2ab48ef048f58f8e0f5f374ac9b7 (diff) | |
parent | 3c0a4529b05ed8b3d9fadf97238e3d462d0ce733 (diff) |
Merge pull request #1260 from Razican/db_ac
Added the ability to insert objects with insert_batch() in Active Record
Diffstat (limited to 'system')
-rw-r--r-- | system/database/DB_active_rec.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index a5df7f31a..e78b2a893 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -1252,11 +1252,12 @@ abstract class CI_DB_active_record extends CI_DB_driver { $key = array($key => $value); } - $keys = array_keys(current($key)); + $keys = array_keys($this->_object_to_array(current($key))); sort($keys); foreach ($key as $row) { + $row = $this->_object_to_array($row); if (count(array_diff($keys, array_keys($row))) > 0 OR count(array_diff(array_keys($row), $keys)) > 0) { // batch function above returns an error on an empty array |