/** * Insert a new record into the database. * * @param array $values * @return bool */ public function insert(array $values) { if (!is_array(reset($values))) { $values = array($values); } else { foreach ($values as $key => $value) { ksort($value); $values[$key] = $value; } } $bindings = array(); foreach ($values as $record) { foreach ($record as $value) { $bindings[] = $value; } } $sql = $this->grammar->compileInsert($this, $values); $bindings = $this->cleanBindings($bindings); return $this->connection->insert($sql, $bindings); }