PHP Class CI_DB_result, TastyIgniter

This is the platform-independent result class. This class will not be called directly. Rather, the adapter class for the specific database will extend and instantiate it.
Author: EllisLab Dev Team
Show file Open project: tastyigniter/tastyigniter Class Usage Examples

Public Properties

Property Type Description
$conn_id resource | object Connection ID
$current_row integer Current Row index
$custom_result_object object[] Custom Result Object
$num_rows integer Number of rows
$result_array array[] Result Array
$result_id resource | object Result ID
$result_object object[] Result Object
$row_data array Row data

Public Methods

Method Description
__construct ( object &$driver_object ) : void Constructor
custom_result_object ( string $class_name ) : array Custom query result.
custom_row_object ( integer $n, string $type ) : object Returns a single result row - custom object version
data_seek ( integer $n ) : boolean Data Seek
field_data ( ) : array Field data
first_row ( string $type = 'object' ) : mixed Returns the "first" row
free_result ( ) : void Free the result
last_row ( string $type = 'object' ) : mixed Returns the "last" row
list_fields ( ) : array Fetch Field Names
next_row ( string $type = 'object' ) : mixed Returns the "next" row
num_fields ( ) : integer Number of fields in the result set
num_rows ( ) : integer Number of rows in the result set
previous_row ( string $type = 'object' ) : mixed Returns the "previous" row
result ( string $type = 'object' ) : array Query result. Acts as a wrapper function for the following functions.
result_array ( ) : array Query result. "array" version.
result_object ( ) : array Query result. "object" version.
row ( mixed $n, string $type = 'object' ) : mixed Row
row_array ( integer $n ) : array Returns a single result row - array version
row_object ( integer $n ) : object Returns a single result row - object version
set_row ( mixed $key, mixed $value = NULL ) : void Assigns an item into a particular column slot
unbuffered_row ( string $type = 'object' ) : mixed Returns an unbuffered row and move pointer to next row

Protected Methods

Method Description
_fetch_assoc ( ) : array Result - associative array
_fetch_object ( string $class_name = 'stdClass' ) : object Result - object

Method Details

__construct() public method

Constructor
public __construct ( object &$driver_object ) : void
$driver_object object
return void

_fetch_assoc() protected method

Returns the result set as an array. Overridden by driver result classes.
protected _fetch_assoc ( ) : array
return array

_fetch_object() protected method

Returns the result set as an object. Overridden by driver result classes.
protected _fetch_object ( string $class_name = 'stdClass' ) : object
$class_name string
return object

custom_result_object() public method

Custom query result.
public custom_result_object ( string $class_name ) : array
$class_name string
return array

custom_row_object() public method

Returns a single result row - custom object version
public custom_row_object ( integer $n, string $type ) : object
$n integer
$type string
return object

data_seek() public method

Moves the internal pointer to the desired offset. We call this internally before fetching results to make sure the result set starts at zero. Overridden by driver result classes.
public data_seek ( integer $n ) : boolean
$n integer
return boolean

field_data() public method

Generates an array of objects containing field meta-data. Overridden by driver result classes.
public field_data ( ) : array
return array

first_row() public method

Returns the "first" row
public first_row ( string $type = 'object' ) : mixed
$type string
return mixed

free_result() public method

Overridden by driver result classes.
public free_result ( ) : void
return void

last_row() public method

Returns the "last" row
public last_row ( string $type = 'object' ) : mixed
$type string
return mixed

list_fields() public method

Generates an array of column names. Overridden by driver result classes.
public list_fields ( ) : array
return array

next_row() public method

Returns the "next" row
public next_row ( string $type = 'object' ) : mixed
$type string
return mixed

num_fields() public method

Overridden by driver result classes.
public num_fields ( ) : integer
return integer

num_rows() public method

Number of rows in the result set
public num_rows ( ) : integer
return integer

previous_row() public method

Returns the "previous" row
public previous_row ( string $type = 'object' ) : mixed
$type string
return mixed

result() public method

Query result. Acts as a wrapper function for the following functions.
public result ( string $type = 'object' ) : array
$type string 'object', 'array' or a custom class name
return array

result_array() public method

Query result. "array" version.
public result_array ( ) : array
return array

result_object() public method

Query result. "object" version.
public result_object ( ) : array
return array

row() public method

A wrapper method.
public row ( mixed $n, string $type = 'object' ) : mixed
$n mixed
$type string 'object' or 'array'
return mixed

row_array() public method

Returns a single result row - array version
public row_array ( integer $n ) : array
$n integer
return array

row_object() public method

Returns a single result row - object version
public row_object ( integer $n ) : object
$n integer
return object

set_row() public method

Assigns an item into a particular column slot
public set_row ( mixed $key, mixed $value = NULL ) : void
$key mixed
$value mixed
return void

unbuffered_row() public method

Returns an unbuffered row and move pointer to next row
public unbuffered_row ( string $type = 'object' ) : mixed
$type string 'array', 'object' or a custom class name
return mixed

Property Details

$conn_id public property

Connection ID
public resource|object $conn_id
return resource | object

$current_row public property

Current Row index
public int $current_row
return integer

$custom_result_object public property

Custom Result Object
public object[] $custom_result_object
return object[]

$num_rows public property

Number of rows
public int $num_rows
return integer

$result_array public property

Result Array
public array[] $result_array
return array[]

$result_id public property

Result ID
public resource|object $result_id
return resource | object

$result_object public property

Result Object
public object[] $result_object
return object[]

$row_data public property

Row data
public array $row_data
return array