Added the ability to insert objects with insert_batch() in Active Reccord.
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index a5df7f3..e78b2a8 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -1252,11 +1252,12 @@
$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