Open Journal Systems  3.3.0
DBRowIterator Class Reference
Inheritance diagram for DBRowIterator:
ItemIterator

Public Member Functions

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

Data Fields

 $count
 
 $idFields
 
 $isFirst
 
 $isLast
 
 $page
 
 $pageCount
 
 $records
 
 $wasEmpty
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

DBRowIterator::__construct (   $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 $idFields, $records, and wasEmpty().

Member Function Documentation

◆ atFirstPage()

DBRowIterator::atFirstPage ( )

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

Returns
boolean

Reimplemented from ItemIterator.

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

References $isFirst.

◆ atLastPage()

DBRowIterator::atLastPage ( )

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

Returns
boolean

Reimplemented from ItemIterator.

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

References $isLast.

◆ close()

DBRowIterator::close ( )

Clean up the record set. This is called aggressively because it can free resources.

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

Referenced by eof(), and next().

◆ eof()

DBRowIterator::eof ( )

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

Returns
boolean

Reimplemented from ItemIterator.

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

References close().

Referenced by toArray().

◆ getCount()

DBRowIterator::getCount ( )

Get the total number of items in the set.

Returns
int

Reimplemented from ItemIterator.

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

References $count.

◆ getPage()

DBRowIterator::getPage ( )

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

Returns
int

Reimplemented from ItemIterator.

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

References $page.

◆ getPageCount()

DBRowIterator::getPageCount ( )

Get the total number of pages in the set.

Returns
int

Reimplemented from ItemIterator.

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

References $pageCount.

◆ next()

DBRowIterator::next ( )

Return the object representing the next row.

Returns
object

Reimplemented from ItemIterator.

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

References $records, and close().

Referenced by nextWithKey(), and toArray().

◆ nextWithKey()

DBRowIterator::nextWithKey ( )

Return the next row, with key.

Returns
array ($key, $value)

Reimplemented from ItemIterator.

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

References next().

◆ toArray()

DBRowIterator::toArray ( )

Convert this iterator to an array.

Returns
array

Reimplemented from ItemIterator.

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

References eof(), and next().

◆ wasEmpty()

DBRowIterator::wasEmpty ( )

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

Returns
boolean

Reimplemented from ItemIterator.

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

References $wasEmpty.

Referenced by __construct().

Field Documentation

◆ $count

DBRowIterator::$count

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

Referenced by getCount().

◆ $idFields

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.

Referenced by __construct().

◆ $isFirst

DBRowIterator::$isFirst

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

Referenced by atFirstPage().

◆ $isLast

DBRowIterator::$isLast

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

Referenced by atLastPage().

◆ $page

DBRowIterator::$page

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

Referenced by getPage().

◆ $pageCount

DBRowIterator::$pageCount

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

Referenced by getPageCount().

◆ $records

DBRowIterator::$records

The ADORecordSet to be wrapped around

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

Referenced by __construct(), and next().

◆ $wasEmpty

DBRowIterator::$wasEmpty

True iff the resultset was always empty

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

Referenced by wasEmpty().


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