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

Public Member Functions

 _cleanup ()
 
 atFirstPage ()
 
 atLastPage ()
 
 DAOResultFactory (&$records, &$dao, $functionName, $idFields=array())
 
 eof ()
 
 getCount ()
 
getLastPageRangeInfo ()
 
 getPage ()
 
 getPageCount ()
 
 isInBounds ()
 
 move ($to)
 
next ()
 
nextWithKey ($idField=null)
 
toArray ()
 
toAssociativeArray ($idField= 'id')
 
 wasEmpty ()
 
- Public Member Functions inherited from ItemIterator
 atFirstPage ()
 
 atLastPage ()
 
 eof ()
 
 getCount ()
 
 getPage ()
 
 getPageCount ()
 
next ()
 
nextWithKey ()
 
toArray ()
 
 wasEmpty ()
 

Public Attributes

 $dao
 
 $functionName
 
 $records
 
 $wasEmpty
 

Detailed Description

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

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

Member Function Documentation

DAOResultFactory::_cleanup ( )

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

Definition at line 202 of file DAOResultFactory.inc.php.

Referenced by eof(), and next().

DAOResultFactory::atFirstPage ( )

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

Returns
boolean

Definition at line 141 of file DAOResultFactory.inc.php.

DAOResultFactory::atLastPage ( )

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

Returns
boolean

Definition at line 149 of file DAOResultFactory.inc.php.

DAOResultFactory::DAOResultFactory ( $records,
$dao,
  $functionName,
  $idFields = array() 
)

Constructor. Initialize the DAOResultFactory

Parameters
$recordsobject ADO record set
$daoobject DAO class for factory
$functionNameThe function to call on $dao to create an object
$idFieldsarray an array of primary key field names that uniquely identify a result row in the record set. Should be data object _data array key, not database column name

Definition at line 55 of file DAOResultFactory.inc.php.

References $dao, $functionName, $records, and wasEmpty().

DAOResultFactory::eof ( )

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

Returns
boolean

Definition at line 181 of file DAOResultFactory.inc.php.

References _cleanup().

Referenced by toArray(), and toAssociativeArray().

DAOResultFactory::getCount ( )

Get the total number of items in the set.

Returns
int

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

& DAOResultFactory::getLastPageRangeInfo ( )

Get the RangeInfo representing the last page in the set.

Returns
object

Definition at line 246 of file DAOResultFactory.inc.php.

DAOResultFactory::getPage ( )

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

Returns
int

Definition at line 157 of file DAOResultFactory.inc.php.

DAOResultFactory::getPageCount ( )

Get the total number of pages in the set.

Returns
int

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

DAOResultFactory::isInBounds ( )

Determine whether or not this iterator is in the range of pages for the set it represents

Returns
boolean

Definition at line 238 of file DAOResultFactory.inc.php.

DAOResultFactory::move (   $to)

Advances the internal cursor to a specific row.

Parameters
int$to
Returns
boolean

Definition at line 85 of file DAOResultFactory.inc.php.

& DAOResultFactory::next ( )

Return the object representing the next row.

Returns
object

Definition at line 97 of file DAOResultFactory.inc.php.

References $dao, $functionName, $records, and _cleanup().

Referenced by nextWithKey(), toArray(), and toAssociativeArray().

& DAOResultFactory::nextWithKey (   $idField = null)

Return the next row, with key.

Returns
array ($key, $value)

Definition at line 117 of file DAOResultFactory.inc.php.

References next().

& DAOResultFactory::toArray ( )

Convert this iterator to an array.

Returns
array

Definition at line 212 of file DAOResultFactory.inc.php.

References eof(), and next().

& DAOResultFactory::toAssociativeArray (   $idField = 'id')

Convert this iterator to an associative array by database ID.

Returns
array

Definition at line 224 of file DAOResultFactory.inc.php.

References eof(), and next().

DAOResultFactory::wasEmpty ( )

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

Returns
boolean

Definition at line 194 of file DAOResultFactory.inc.php.

References $wasEmpty.

Referenced by DAOResultFactory().

Member Data Documentation

DAOResultFactory::$dao

The DAO used to create objects

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

Referenced by DAOResultFactory(), and next().

DAOResultFactory::$functionName

The name of the DAO's factory function (to be called with an associative array of values)

Definition at line 25 of file DAOResultFactory.inc.php.

Referenced by DAOResultFactory(), and next().

DAOResultFactory::$records

The ADORecordSet to be wrapped around

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

Referenced by DAOResultFactory(), and next().

DAOResultFactory::$wasEmpty

True iff the resultset was always empty

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

Referenced by wasEmpty().


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