Public Member Functions | |
__construct (PgSQLResultSet $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. | |
seek ($index) | |
Sets cursor to specific value. | |
count () | |
Private Attributes | |
$result | |
$pos = 0 | |
$fetchmode | |
$row_count | |
$rs |
Definition at line 31 of file PgSQLResultSetIterator.php.
PgSQLResultSetIterator::__construct | ( | PgSQLResultSet $ | rs | ) |
Construct the iterator.
PgSQLResultSet | $rs |
Definition at line 43 of file PgSQLResultSetIterator.php.
References ResultSetCommon::getFetchmode(), PgSQLResultSet::getRecordCount(), and ResultSetCommon::getResource().
00044 { 00045 $this->result = $rs->getResource(); 00046 $this->fetchmode = $rs->getFetchmode(); 00047 $this->row_count = $rs->getRecordCount(); 00048 $this->rs = $rs; // This is to address reference count bug: http://creole.phpdb.org/trac/ticket/6 00049 }
PgSQLResultSetIterator::count | ( | ) |
PgSQLResultSetIterator::current | ( | ) |
Returns the row (assoc array) at current cursor pos.
Definition at line 79 of file PgSQLResultSetIterator.php.
PgSQLResultSetIterator::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.
Definition at line 70 of file PgSQLResultSetIterator.php.
PgSQLResultSetIterator::next | ( | ) |
PgSQLResultSetIterator::rewind | ( | ) |
This method actually has no effect, since we do not rewind ResultSet for iteration.
Definition at line 54 of file PgSQLResultSetIterator.php.
PgSQLResultSetIterator::seek | ( | $ | index | ) |
Sets cursor to specific value.
Definition at line 95 of file PgSQLResultSetIterator.php.
00096 { 00097 if ( ! is_int ( $index ) ) { 00098 throw new InvalidArgumentException ( 'Invalid arguement to seek' ); 00099 } 00100 if ( $index < 0 || $index > $this->row_count ) { 00101 throw new OutOfBoundsException ( 'Invalid seek position' ); 00102 } 00103 $this->pos = $index; 00104 }
PgSQLResultSetIterator::valid | ( | ) |
PgSQLResultSetIterator::$fetchmode [private] |
Definition at line 35 of file PgSQLResultSetIterator.php.
PgSQLResultSetIterator::$pos = 0 [private] |
Definition at line 34 of file PgSQLResultSetIterator.php.
PgSQLResultSetIterator::$result [private] |
Definition at line 33 of file PgSQLResultSetIterator.php.
PgSQLResultSetIterator::$row_count [private] |
Definition at line 36 of file PgSQLResultSetIterator.php.
PgSQLResultSetIterator::$rs [private] |
Definition at line 37 of file PgSQLResultSetIterator.php.