insert_id; } /** * Return the named column from the current row. * * @param string Column name * @return mixed */ public function get($name) { // Get the current row $row = $this->current(); if ( ! $this->return_objects) return $row[$name]; return $row->$name; } /** * Countable: count */ public function count() { return $this->total_rows; } /** * ArrayAccess: offsetExists */ public function offsetExists($offset) { return ($offset >= 0 AND $offset < $this->total_rows); } /** * ArrayAccess: offsetGet */ public function offsetGet($offset) { if ( ! $this->seek($offset)) return NULL; return $this->current(); } /** * ArrayAccess: offsetSet * * @throws Kohana_Database_Exception */ final public function offsetSet($offset, $value) { throw new Kohana_Exception('Database results are read-only'); } /** * ArrayAccess: offsetUnset * * @throws Kohana_Database_Exception */ final public function offsetUnset($offset) { throw new Kohana_Exception('Database results are read-only'); } /** * Iterator: key */ public function key() { return $this->current_row; } /** * Iterator: next */ public function next() { ++$this->current_row; return $this; } /** * Iterator: prev */ public function prev() { --$this->current_row; return $this; } /** * Iterator: rewind */ public function rewind() { $this->current_row = 0; return $this; } /** * Iterator: valid */ public function valid() { return $this->offsetExists($this->current_row); } } // End Database_Result