Пример #1
0
 /**
  * Get array of the query
  *
  * @param int $offset (For non cached results)
  * @param int $len (For non cached results)
  * @param int $fields_type (0-Normal,1-Assoc, 2-Object)
  * @param int $rows_type((0-Normal,1-Assoc, 2-Object))
  * @param string $rows_type_field (name of the field to become index for Assoc $rows_type)
  * @return array
  */
 public function fetchRecords($offset = 0, $len = 0, $fields_type = 1, $rows_type = 0, $rows_type_field = '')
 {
     if ($this->is_result_cached) {
         if ($rows_type == 1 and !empty($rows_type_field)) {
             $array_to_return = array();
             foreach ($this->result as $key => $val) {
                 $array_to_return[$val[$rows_type_field]] = $val;
             }
             return $this->convertResultSetType($array_to_return, $fields_type);
         } elseif ($rows_type == 0) {
             return $this->convertResultSetType($this->result, $fields_type);
         }
     } else {
         return parent::fetchRecords($offset, $len, $fields_type, $rows_type, $rows_type_field);
     }
 }