Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
DBRowIterator Class Reference
Inheritance diagram for DBRowIterator:
ItemIterator

Public Member Functions

 _cleanup ()
 
 atFirstPage ()
 
 atLastPage ()
 
 DBRowIterator (&$records, $idFields=array())
 
 eof ()
 
 getCount ()
 
 getPage ()
 
 getPageCount ()
 
next ()
 
nextWithKey ()
 
toArray ()
 
 wasEmpty ()
 
- Public Member Functions inherited from ItemIterator
 atFirstPage ()
 
 atLastPage ()
 
 eof ()
 
 getCount ()
 
 getPage ()
 
 getPageCount ()
 
next ()
 
nextWithKey ()
 
toArray ()
 
 wasEmpty ()
 

Public Attributes

 $records
 
 $wasEmpty
 

Detailed Description

Wrapper around ADORecordSet providing "factory" features for generating objects from DAOs.

Definition at line 20 of file DBRowIterator.inc.php.

Member Function Documentation

DBRowIterator::_cleanup ( )

PRIVATE function used internally to clean up the record set. This is called aggressively because it can free resources.

Definition at line 173 of file DBRowIterator.inc.php.

Referenced by eof(), and next().

DBRowIterator::atFirstPage ( )

Determine whether this iterator represents the first page of a set.

Returns
boolean

Definition at line 112 of file DBRowIterator.inc.php.

DBRowIterator::atLastPage ( )

Determine whether this iterator represents the last page of a set.

Returns
boolean

Definition at line 120 of file DBRowIterator.inc.php.

DBRowIterator::DBRowIterator ( $records,
  $idFields = array() 
)

Constructor. Initialize the DBRowIterator

Parameters
$recordsobject ADO record set
$daoobject DAO class for factory
$functionNameThe function to call on $dao to create an object

Definition at line 46 of file DBRowIterator.inc.php.

References $records, and wasEmpty().

DBRowIterator::eof ( )

Return a boolean indicating whether or not we've reached the end of results

Returns
boolean

Definition at line 152 of file DBRowIterator.inc.php.

References _cleanup().

Referenced by toArray().

DBRowIterator::getCount ( )

Get the total number of items in the set.

Returns
int

Definition at line 136 of file DBRowIterator.inc.php.

DBRowIterator::getPage ( )

Get the page number of a set that this iterator represents.

Returns
int

Definition at line 128 of file DBRowIterator.inc.php.

DBRowIterator::getPageCount ( )

Get the total number of pages in the set.

Returns
int

Definition at line 144 of file DBRowIterator.inc.php.

& DBRowIterator::next ( )

Return the object representing the next row.

Returns
object

Definition at line 74 of file DBRowIterator.inc.php.

References $records, and _cleanup().

Referenced by nextWithKey(), and toArray().

& DBRowIterator::nextWithKey ( )

Return the next row, with key.

Returns
array ($key, $value)

Definition at line 91 of file DBRowIterator.inc.php.

References next().

& DBRowIterator::toArray ( )

Convert this iterator to an array.

Returns
array

Definition at line 183 of file DBRowIterator.inc.php.

References eof(), and next().

DBRowIterator::wasEmpty ( )

Return a boolean indicating whether or not this resultset was empty from the beginning

Returns
boolean

Definition at line 165 of file DBRowIterator.inc.php.

References $wasEmpty.

Referenced by DBRowIterator().

Member Data Documentation

DBRowIterator::$records

The ADORecordSet to be wrapped around

Definition at line 22 of file DBRowIterator.inc.php.

Referenced by DBRowIterator(), and next().

DBRowIterator::$wasEmpty

True iff the resultset was always empty

Definition at line 31 of file DBRowIterator.inc.php.

Referenced by wasEmpty().


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