public function insert($rows, $ignore = false) { ORM::get_db()->beginTransaction(); foreach ($rows as $row) { $class = $this->_class_name; $class::create($row)->save($ignore); } ORM::get_db()->commit(); return ORM::get_db()->lastInsertId(); }