Propel 2 API
Class

Propel\Runtime\Collection\OnDemandIterator

class OnDemandIterator implements Iterator

Class for iterating over a statement and returning one Propel object at a time

Methods

__construct(AbstractFormatter $formatter, DataFetcherInterface $dataFetcher)

closeCursor()

integer count()

Returns the number of rows in the resultset Warning: this number is inaccurate for most databases.

BaseObject current()

Gets the current Model object in the collection This is where the hydration takes place.

string key()

Gets the current key in the iterator

next()

Advances the cursor in the statement Closes the cursor if the end of the statement is reached

rewind()

Initializes the iterator by advancing to the first position This method can only be called once (this is a NoRewindIterator)

boolean valid()

Details

at line 47
public __construct(AbstractFormatter $formatter, DataFetcherInterface $dataFetcher)

Parameters

AbstractFormatter $formatter
DataFetcherInterface $dataFetcher

at line 55
public closeCursor()

at line 69
public integer count()

Returns the number of rows in the resultset Warning: this number is inaccurate for most databases.

Do not rely on it for a portable application.

Return Value

integer Number of results

at line 84
public BaseObject current()

Gets the current Model object in the collection This is where the hydration takes place.

Return Value

BaseObject

See also

ObjectFormatter::getAllObjectsFromRow()

at line 94
public string key()

Gets the current key in the iterator

Return Value

string

at line 103
public next()

Advances the cursor in the statement Closes the cursor if the end of the statement is reached

at line 117
public rewind()

Initializes the iterator by advancing to the first position This method can only be called once (this is a NoRewindIterator)

at line 137
public boolean valid()

Return Value

boolean