PHP Class Pheasant\Query\QueryIterator

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

Public Methods

Method Description
__construct ( $query, $hydrator = null ) Constructor
before ( $callback ) Add a callback to be called with the query before it's executed
count ( ) Counts the number or results in the query
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 ( $hydrator ) Sets a hydrator to be used
valid ( ) : boolean Returns true if the current position is valid, false otherwise.

Private Methods

Method Description
_hydrate ( $row ) Hydrates a row into an object
_iterator ( ) Returns the delegate iterator from the resultset
_resultSet ( ) Returns the query result set iterator, executing the query if needed

Method Details

__construct() public method

Constructor
public __construct ( $query, $hydrator = null )

before() public method

Add a callback to be called with the query before it's executed
public before ( $callback )

count() public method

Counts the number or results in the query
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 to be used
public setHydrator ( $hydrator )

valid() public method

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