Iterator Class Reference

List of all members.

Public Member Functions


Detailed Description

The Iterator returned by DataSet::getIterator() that loops through the records.

Thanks to PHP5 SPL this allows you to foreach() over a DataSet: $ds = new QueryDataSet($conn, "select * from author"); $ds->fetchRecords(); foreach($ds as $rec) { print $rec->getValue("mycol"); }

See also DataSet::getIterator()


Member Function Documentation

Iterator::__construct ( SQLiteResultSet $rs )

 

Construct the iterator.
Parameters
SQLiteResultSet $rs

Iterator::rewind ( )

 

This method actually has no effect, since we do not rewind ResultSet for iteration.

Iterator::valid ( )

 

int Iterator::key ( )

 

Returns the cursor position. Note that this will not necessarily be 1 for the first row, since no rewind is performed at beginning of iteration.
Returns int

array Iterator::current ( )

 

Returns the row (assoc array) at current cursor pos.
Returns array

Iterator::next ( )

 

Advances internal cursor pos.

Iterator::__construct ( ResultSet $rs )

 

Construct the iterator.
Parameters
ResultSet $rs

Iterator::rewind ( )

 

If not at start of resultset, this method will call seek(0).
See also ResultSet::seek()

Iterator::valid ( )

 

This method checks to see whether there are more results by advancing the cursor position.
See also ResultSet::next()

int Iterator::key ( )

 

Returns the cursor position.
Returns int

array Iterator::current ( )

 

Returns the row (assoc array) at current cursor pos.
Returns array

Iterator::next ( )

 

This method does not actually do anything since we have already advanced the cursor pos in valid().
See also valid()

Iterator::__construct ( DataSet $ds )

 

Iterator::rewind ( )

 

Iterator::valid ( )

 

Iterator::key ( )

 

Iterator::current ( )

 

Iterator::next ( )

 


This file is part of the Creole[php5] library.


Copyright © 2004 Hans Lellelid  
Creole[php5] CVS