Open Monograph Press  1.1
 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
 
 $idFields
 
 $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 217 of file DAOResultFactory.inc.php.

DAOResultFactory::atFirstPage ( )

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

Returns
boolean

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

DAOResultFactory::atLastPage ( )

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

Returns
boolean

Definition at line 164 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 70 of file DAOResultFactory.inc.php.

DAOResultFactory::eof ( )

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

Returns
boolean

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

DAOResultFactory::getCount ( )

Get the total number of items in the set.

Returns
int

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

& DAOResultFactory::getLastPageRangeInfo ( )

Get the RangeInfo representing the last page in the set.

Returns
object

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

DAOResultFactory::getPage ( )

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

Returns
int

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

DAOResultFactory::getPageCount ( )

Get the total number of pages in the set.

Returns
int

Definition at line 188 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 253 of file DAOResultFactory.inc.php.

DAOResultFactory::move (   $to)

Advances the internal cursor to a specific row.

Parameters
int$to
Returns
boolean

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

& DAOResultFactory::next ( )

Return the object representing the next row.

Returns
object

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

DAOResultFactory::nextWithKey (   $idField = null)

Return the next row, with key.

Returns
array ($key, $value)

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

& DAOResultFactory::toArray ( )

Convert this iterator to an array.

Returns
array

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

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

Convert this iterator to an associative array by database ID.

Returns
array

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

DAOResultFactory::wasEmpty ( )

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

Returns
boolean

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

Member Data Documentation

DAO DAOResultFactory::$dao

The DAO used to create objects

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

string DAOResultFactory::$functionName

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

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

array DAOResultFactory::$idFields

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

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

ADORecordSet DAOResultFactory::$records

The ADORecordSet to be wrapped around

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

boolean DAOResultFactory::$wasEmpty

True iff the resultset was always empty

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


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