summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorIban Eguia <admin@razican.com>2012-04-15 13:30:44 +0200
committerIban Eguia <admin@razican.com>2012-04-15 13:30:44 +0200
commit3c0a4529b05ed8b3d9fadf97238e3d462d0ce733 (patch)
treebeee6bd49a9816b61faac3cda06dbaa2ac3fa41d /system/database
parent0f2211711deceb74157d6811116acc0376d3157d (diff)
Added the ability to insert objects with insert_batch() in Active Reccord.
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_active_rec.php3
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