IteratorAggregate Class Reference

Inherited by ResultSet.

List of all members.

Public Member Functions

Public Attributes

Protected Attributes


Member Function Documentation

DataSetIterator IteratorAggregate::getIterator ( )

 

Return iterator (for IteratorAggregate interface). This allows this class to be used in a foreach() loop. foreach($dataset as $record) { print "col1 = " . $record->getValue("col1") . "\n"; }
Returns DataSetIterator

Reimplemented in SQLiteResultSet.

ResultSet IteratorAggregate::resultSet ( )

 

Gets the ResultSet for this DataSet

Returns ResultSet The result set for this DataSet
Exceptions
DataSetException - if resultset is null

boolean IteratorAggregate::allRecordsRetrieved ( )

 

Check if all the records have been retrieve

Returns boolean True if all records have been retrieved

void IteratorAggregate::setAllRecordsRetrieved ( $set )

 

Set all records retrieved
Parameters
boolean $set

Returns void

Record IteratorAggregate::removeRecord ( Record $rec )

 

Remove a record from the DataSet's internal storage

Parameters
Record $rec

Returns Record The record removed

an IteratorAggregate::clearRecords ( )

 

Remove all records from the DataSet and nulls those records out and close() the DataSet.

Returns an instance of myself

an IteratorAggregate::releaseRecords ( )

 

Removes the records from the DataSet, but does not null the records out

Returns an instance of myself

void IteratorAggregate::close ( )

 

Releases the records, closes the ResultSet and the Statement, and nulls the Schema and Connection references.

Returns void

Reimplemented in MSSQLResultSet, MySQLResultSet, OCI8ResultSet, PgSQLResultSet, SQLiteResultSet, and ResultSet.

DataSet IteratorAggregate::reset ( )

 

Essentially the same as releaseRecords, but it won't work on a QueryDataSet that has been created with a ResultSet

Returns DataSet This object.
Exceptions
DataSetException 

Connection IteratorAggregate::connection ( )

 

Gets the current database connection

Returns Connection A database connection.

Schema IteratorAggregate::schema ( )

 

Gets the Schema for this DataSet

Returns Schema The Schema for this DataSet

Record IteratorAggregate::getRecord ( $pos )

 

Get Record at 0 based index position

Parameters
int $pos

Returns Record An instance of the found Record
Exceptions
DataSetException 

Record IteratorAggregate::findRecord ( $pos )

 

Find Record at 0 based index position. This is an internal alternative to getRecord which tries to be smart about the type of record it is.

Parameters
int $pos

Returns Record an instance of the found Record
Exceptions
DataSetException 

true IteratorAggregate::containsRecord ( $pos )

 

Check to see if the DataSet contains a Record at 0 based position

Parameters
pos 

Returns true if record exists

DataSet IteratorAggregate::fetchRecords ( $p1 = 0, $p2 = null )

 

Causes the DataSet to hit the database and fetch max records, starting at start. Record count begins at 0.

This method supports two signatures:

fetchRecords(5, 10); // OFFSET = 5, LIMIT = 10

Parameters
int $p1 max - or start if $p2 is set
int $p2 start

Returns DataSet This class.
Exceptions
SQLException 
DataSetException 

int IteratorAggregate::lastFetchSize ( )

 

The number of records that were fetched with the last fetchRecords.

Returns int

KeyDef IteratorAggregate::keydef ( )

 

gets the KeyDef object for this DataSet

Returns KeyDef The keydef for this DataSet, this value can be null

IteratorAggregate::__toString ( )

 

This returns a represention of this DataSet

string IteratorAggregate::getSelectSql ( ) [pure virtual]

 

Classes extending this class must implement this method.

Returns string The SELECT SQL.
Exceptions
DataSetException; 

the IteratorAggregate::getColumns ( )

 

Returns the columns attribute for the DataSet

Returns the columns attribute for the DataSet

int IteratorAggregate::size ( )

 

Gets the number of Records in this DataSet. It is 0 based.

Returns int Number of Records in this DataSet


Member Data Documentation

const IteratorAggregate::ALL_RECORDS = 0

 

indicates that all records should be retrieved during a fetch

IteratorAggregate::$records [protected]

 

this DataSet's collection of Record objects

IteratorAggregate::$conn [protected]

 

this DataSet's connection object

IteratorAggregate::$allRecordsRetrieved = false [protected]

 

have all records been retrieved with the fetchRecords?

IteratorAggregate::$recordRetrievedCount = 0 [protected]

 

number of records retrieved

IteratorAggregate::$lastFetchSize = 0 [protected]

 

number of records that were last fetched

IteratorAggregate::$totalFetchCount = 0 [protected]

 

number of records total that have been fetched

IteratorAggregate::$columns [protected]

 

the columns in the SELECT statement for this DataSet

IteratorAggregate::$selectSql [protected]

 

the select string that was used to build this DataSet

IteratorAggregate::$keyDef [protected]

 

the KeyDef for this DataSet

IteratorAggregate::$resultSet [protected]

 

the result set for this DataSet

IteratorAggregate::$stmt [protected]

 

the Statement for this DataSet


This file is part of the Creole[php5] library.


Copyright © 2004 Hans Lellelid  
Creole[php5] CVS