/** * Inner helper function for inserting an associative array into * the inserts bit of the database query building. * This automatically expands any inner arrays it finds as elements * to be re-entered. * * */ private function insertArray(&$array) { if (Database::isArray2D($array)) { foreach ($array as $arr) { $this->insertArray($arr); } } else { $newValues = array(); foreach ($array as $key => $value) { $newValues[$key] = $value; } if (isset($this->activerecord['insert'])) { $this->activerecord['insert'][] = $newValues; } else { $this->activerecord['insert'] = array($newValues); } } }