dibi result set.
$result = dibi::query('SELECT * FROM [table]');
$row = $result->fetch();
$value = $result->fetchSingle();
$table = $result->fetchAll();
$pairs = $result->fetchPairs();
$assoc = $result->fetchAssoc('id');
$assoc = $result->fetchAssoc('active,#,id');
unset($result);
Methods summary
public
|
|
final public
mixed
|
#
getResource( )
Returns the result set resource.
Returns the result set resource.
Returns
mixed
|
final public
|
#
free( )
Frees the resources allocated for this result set.
Frees the resources allocated for this result set.
|
final public
boolean
|
#
seek( integer $row )
Moves cursor position without fetching row.
Moves cursor position without fetching row.
Parameters
- $row
integer the 0-based cursor pos to seek to
Returns
boolean TRUE on success, FALSE if unable to seek to specified record
Throws
|
final public
integer
|
#
count( )
Required by the Countable interface.
Required by the Countable interface.
Returns
integer
Implementation of
|
final public
integer
|
#
getRowCount( )
Returns the number of rows in a result set.
Returns the number of rows in a result set.
Returns
integer
|
final public
DibiResultIterator
|
#
getIterator( )
Required by the IteratorAggregate interface.
Required by the IteratorAggregate interface.
Returns
Implementation of
|
public
DibiResult
|
#
setRowClass( string $class )
Set fetched object class. This class should extend the DibiRow class.
Set fetched object class. This class should extend the DibiRow class.
Parameters
Returns
|
public
string
|
#
getRowClass( )
Returns fetched object class name.
Returns fetched object class name.
Returns
string
|
final public
DibiRow|false
|
#
fetch( )
Fetches the row at current position, process optional type conversion. and
moves the internal cursor to the next position
Fetches the row at current position, process optional type conversion. and
moves the internal cursor to the next position
Returns
DibiRow|falsearray on success, FALSE if no next record
|
final public
mixed
|
#
fetchSingle( )
Like fetch(), but returns only first field.
Like fetch(), but returns only first field.
Returns
mixed value on success, FALSE if no next record
|
final public
array
|
#
fetchAll( integer $offset = NULL, integer $limit = NULL )
Fetches all records from table.
Fetches all records from table.
Parameters
- $offset
integer offset
- $limit
integer limit
Returns
array of DibiRow
|
final public
DibiRow
|
#
fetchAssoc( string $assoc )
Fetches all records from table and returns associative tree. Examples:
Fetches all records from table and returns associative tree. Examples:
- associative descriptor: col1[]col2->col3 builds a tree:
$tree[$val1][$index][$val2]->col3[$val3] = {record}
- associative descriptor: col1|col2->col3=col4 builds a tree:
$tree[$val1][$val2]->col3[$val3] = val4
Parameters
- $assoc
string associative descriptor
Returns
Throws
|
final public
array
|
#
fetchPairs( string $key = NULL, string $value = NULL )
Fetches all records from table like $key => $value pairs.
Fetches all records from table like $key => $value pairs.
Parameters
- $key
string associative key
- $value
string value
Returns
array
Throws
|
final public
DibiResult
|
#
setType( string $col, string $type )
Define column type.
Parameters
- $col
string column
- $type
string type (use constant Dibi::*)
Returns
|
final public
string
|
#
getType( $col )
Returns column type.
Returns
string
|
public
DibiResultInfo
|
#
getInfo( )
Returns a meta information about the current result set.
Returns a meta information about the current result set.
Returns
|
final public
|
#
dump( )
Displays complete result set as HTML table for debug purposes.
Displays complete result set as HTML table for debug purposes.
|