Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added the ability to insert objects with insert_batch() in Active Rec…

…cord.
  • Loading branch information...
commit 3c0a4529b05ed8b3d9fadf97238e3d462d0ce733 1 parent 0f22117
@Razican Razican authored
View
3  system/database/DB_active_rec.php
@@ -1252,11 +1252,12 @@ public function set_insert_batch($key, $value = '', $escape = TRUE)
$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
View
1  user_guide_src/source/changelog.rst
@@ -54,6 +54,7 @@ Release Date: Not Released
- Database
+ - Added the ability to insert objects with insert_batch() in :doc:`Active Record <database/active_record>`.
- Added new :doc:`Active Record <database/active_record>` methods that return
the SQL string of queries without executing them: get_compiled_select(),
get_compiled_insert(), get_compiled_update(), get_compiled_delete().
Please sign in to comment.
Something went wrong with that request. Please try again.