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(): int { return $this->total_rows; } /** * ArrayAccess: offsetExists */ public function offsetExists($offset): bool { return ($offset >= 0 AND $offset < $this->total_rows); } /** * ArrayAccess: offsetGet */ public function offsetGet($offset): mixed { if ( ! $this->seek($offset)) return NULL; return $this->current(); } /** * ArrayAccess: offsetSet * * @throws Kohana_Database_Exception */ final public function offsetSet($offset, $value): void { throw new Kohana_Exception('Database results are read-only'); } /** * ArrayAccess: offsetUnset * * @throws Kohana_Database_Exception */ #[\ReturnTypeWillChange] final public function offsetUnset($offset) { throw new Kohana_Exception('Database results are read-only'); } /** * Iterator: key */ public function key(): mixed { return $this->current_row; } /** * Iterator: next */ public function next(): void { ++$this->current_row; } /** * Iterator: prev */ public function prev() { --$this->current_row; return $this; } /** * Iterator: rewind */ public function rewind(): void { $this->current_row = 0; } /** * Iterator: valid */ public function valid(): bool { return $this->offsetExists($this->current_row); } } // End Database_Result