SQLiteResultSetIterator Class Reference

List of all members.

Public Member Functions

 __construct (SQLiteResultSet $rs)
 Construct the iterator.
 rewind ()
 This method actually has no effect, since we do not rewind ResultSet for iteration.
 valid ()
 key ()
 Returns the cursor position.
 current ()
 Returns the row (assoc array) at current cursor pos.
 next ()
 Advances internal cursor pos.

Private Attributes

 $result
 $pos = 0
 $fetchmode
 $row_count


Detailed Description

Definition at line 29 of file SQLiteResultSetIterator.php.


Constructor & Destructor Documentation

SQLiteResultSetIterator::__construct ( SQLiteResultSet rs  ) 

Construct the iterator.

Parameters:
SQLiteResultSet $rs

Definition at line 40 of file SQLiteResultSetIterator.php.

References ResultSetCommon::getFetchmode(), SQLiteResultSet::getRecordCount(), and ResultSetCommon::getResource().

00041     {
00042         $this->result = $rs->getResource();
00043         $this->fetchmode = $rs->getFetchmode();
00044   $this->row_count = $rs->getRecordCount();
00045     }


Member Function Documentation

SQLiteResultSetIterator::current (  ) 

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

Returns:
array

Definition at line 75 of file SQLiteResultSetIterator.php.

00076     {
00077        return sqlite_fetch_array($this->result, $this->fetchmode);
00078     }

SQLiteResultSetIterator::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

Definition at line 66 of file SQLiteResultSetIterator.php.

00067     {
00068         return $this->pos;
00069     }

SQLiteResultSetIterator::next (  ) 

Advances internal cursor pos.

Definition at line 83 of file SQLiteResultSetIterator.php.

00084     {
00085         $this->pos++;
00086     }

SQLiteResultSetIterator::rewind (  ) 

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

Definition at line 50 of file SQLiteResultSetIterator.php.

00051     {        
00052         sqlite_rewind($this->result);
00053     }

SQLiteResultSetIterator::valid (  ) 

Definition at line 55 of file SQLiteResultSetIterator.php.

00056     {
00057   return ( $this->pos < $this->row_count );
00058     }


Member Data Documentation

SQLiteResultSetIterator::$fetchmode [private]

Definition at line 33 of file SQLiteResultSetIterator.php.

SQLiteResultSetIterator::$pos = 0 [private]

Definition at line 32 of file SQLiteResultSetIterator.php.

SQLiteResultSetIterator::$result [private]

Definition at line 31 of file SQLiteResultSetIterator.php.

SQLiteResultSetIterator::$row_count [private]

Definition at line 34 of file SQLiteResultSetIterator.php.


The documentation for this class was generated from the following file:

Generated on Wed May 6 23:10:50 2009 for fareofficelib by  doxygen 1.5.8