Open Monograph Press  1.1
 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

 $idFields
 
 $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 176 of file DBRowIterator.inc.php.

DBRowIterator::atFirstPage ( )

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

Returns
boolean

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

DBRowIterator::atLastPage ( )

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

Returns
boolean

Definition at line 123 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 49 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 155 of file DBRowIterator.inc.php.

DBRowIterator::getCount ( )

Get the total number of items in the set.

Returns
int

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

DBRowIterator::getPage ( )

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

Returns
int

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

DBRowIterator::getPageCount ( )

Get the total number of pages in the set.

Returns
int

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

& DBRowIterator::next ( )

Return the object representing the next row.

Returns
object

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

& DBRowIterator::nextWithKey ( )

Return the next row, with key.

Returns
array ($key, $value)

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

& DBRowIterator::toArray ( )

Convert this iterator to an array.

Returns
array

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

DBRowIterator::wasEmpty ( )

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

Returns
boolean

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

Referenced by DBRowIterator().

Member Data Documentation

array DBRowIterator::$idFields

an array of primary key field names that uniquely identify a result row in the records array.

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

DBRowIterator::$records

The ADORecordSet to be wrapped around

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

Referenced by DBRowIterator().

DBRowIterator::$wasEmpty

True iff the resultset was always empty

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


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