/** * ArrayAccess method * * @param <type> $offset * @param <type> $step * @return <type> */ public function offsetGet($offset, $step = false) { if ($this->offsetExists($offset)) { $this->jumpTo($offset); $return = $this->result->fetch_array(); ++$this->row_pointer; if ($step) { $this->jumpTo($offset); } return $return; } }
/** * Fetches the next row from the result. * * @param integer $mode One of RPG_Database_Result::(ASSOC|NUM|BOTH|OBJECT). * Defaults to ASSOC. * @return array|stdClass */ public function fetch($mode = self::ASSOC) { if (is_string($mode)) { $mode = strtoupper($mode); if (in_array($mode, self::$_fetchModes)) { $mode = constant('self::' . $mode); } } if ($mode === self::OBJECT) { return $this->_result->fetch_object(); } return $this->_result->fetch_array($mode); }
public function fetch_array($type_cast = false) { return $type_cast ? $this->type_cast(parent::fetch_array(MYSQLI_BOTH)) : parent::fetch_array(MYSQLI_BOTH); }