Class ResultSet

Description

Implements interfaces:

  • Iterator (internal interface)
  • Countable (internal interface)

Contains a set of database results, but is database indepenent, and allows the traversing of the database records as well as access to the data.

Located in /class.resultset.php (line 25)


                
			
Method Summary
ResultSet __construct ( &$oDatabase,  &$rQueryResource, Database $oDatabase, Resource $rQueryResource)
int Count ()
StdClass Current ()
StdClass GetRecord ()
int Key ()
void Next ()
void Rewind ()
bool Valid ()
Methods
Constructor __construct (line 65)

Stores the supplied database and query resource for later processing. Counts the number of rows in the query resource and stores for later use.

  • access: public
ResultSet __construct ( &$oDatabase,  &$rQueryResource, Database $oDatabase, Resource $rQueryResource)
  • Database $oDatabase: An instance of a database connection
  • Resource $rQueryResource: A reference to the database result returned by a query
  • &$oDatabase
  • &$rQueryResource
Count (line 97)

Returns the number of rows returned by the query this result set originated from

  • return: The number of rows in the query resource resulting from the query
  • access: public
int Count ()

Implementation of:
Countable::count
Current (line 111)

Returns the data record for the current row, if any, or false if there is not a current row

  • return: The current data record for the current row, or false if there is no data
  • access: public
StdClass Current ()

Implementation of:
Iterator::current
GetRecord (line 85)

Returns a copy of the current record, if any, or null if no record is stored

  • return: The current data record, or null if none
  • access: public
StdClass GetRecord ()
Key (line 131)

Returns the key for the current data. This is defined as the current row of data in the query result.

  • return: The current row loaded into the ResultSet from the query resource
  • access: public
int Key ()

Implementation of:
Iterator::key
Next (line 143)

Attempts to advance the internal pointer of the query result to the next row of data.

On success, the data is loaded into this object. On failure, the data is cleared and operations such as current will return false.

  • access: public
void Next ()

Implementation of:
Iterator::next
Rewind (line 174)

Returns the internal pointer of the query result to the first row of the data.

  • access: public
void Rewind ()

Implementation of:
Iterator::rewind
Valid (line 194)

Returns whether there is any data currently loaded in the ResultSet. If no data was returned by the query, or if the internal pointer is out of bounds (higher than the number of results in the query), this method will return false.

  • return: True if there is data currently loaded in the result set, false otherwise
  • access: public
bool Valid ()

Implementation of:
Iterator::valid

Documentation generated on Thu, 25 Feb 2010 15:59:41 -0500 by phpDocumentor 1.4.3