PHP Class Pheasant\Database\Mysqli\ResultIterator

Inheritance: implements SeekableIterator, implements Countable
Show file Open project: lox/pheasant

Public Methods

Method Description
__construct ( MySQLi_Result $result ) Constructor
__destruct ( ) Destructor Frees the Result object
count ( ) Returns the number of rows in the result
current ( ) : array Returns the row that matches the current position
key ( ) : integer Returns the current position
next ( ) Moves the internal pointer one step forward
rewind ( ) Rewinds the internal pointer
seek ( $position ) Seeks to a particular position in the result, offset is from 0.
setHydrator ( $callback ) Sets a hydrator
toArray ( )
valid ( ) : boolean Returns true if the current position is valid, false otherwise.

Private Methods

Method Description
_fetch ( ) Template for fetching the array

Method Details

__construct() public method

Constructor
public __construct ( MySQLi_Result $result )
$result MySQLi_Result

__destruct() public method

Destructor Frees the Result object
public __destruct ( )

count() public method

Returns the number of rows in the result
public count ( )

current() public method

Returns the row that matches the current position
public current ( ) : array
return array

key() public method

Returns the current position
public key ( ) : integer
return integer

next() public method

Moves the internal pointer one step forward
public next ( )

rewind() public method

Rewinds the internal pointer
public rewind ( )

seek() public method

Seeks to a particular position in the result, offset is from 0.
public seek ( $position )

setHydrator() public method

Sets a hydrator
public setHydrator ( $callback )

toArray() public method

public toArray ( )

valid() public method

Returns true if the current position is valid, false otherwise.
public valid ( ) : boolean
return boolean