jargon
[ class tree: jargon ] [ index: jargon ] [ all elements ]

Class: QueryDataSet

Source Location: /jargon/QueryDataSet.php

Class Overview

DataSet
   |
   --QueryDataSet

This class is used to represent the results of a SQL select statements on the database.


Author(s):

Version:

  • $Revision: 1.3 $

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: DataSet

DataSet::allRecordsRetrieved()
Check if all the records have been retrieve
DataSet::clearRecords()
Remove all records from the DataSet and nulls those records out and close() the DataSet.
DataSet::close()
Releases the records, closes the ResultSet and the Statement, and nulls the Schema and Connection references.
DataSet::connection()
Gets the current database connection
DataSet::containsRecord()
Check to see if the DataSet contains a Record at 0 based position
DataSet::fetchRecords()
Causes the DataSet to hit the database and fetch max records, starting at start. Record count begins at 0.
DataSet::findRecord()
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.
DataSet::getColumns()
Returns the columns attribute for the DataSet
DataSet::getIterator()
Return iterator (for IteratorAggregate interface).
DataSet::getRecord()
Get Record at 0 based index position
DataSet::getSelectSql()
Classes extending this class must implement this method.
DataSet::keydef()
gets the KeyDef object for this DataSet
DataSet::lastFetchSize()
The number of records that were fetched with the last fetchRecords.
DataSet::releaseRecords()
Removes the records from the DataSet, but does not null the records out
DataSet::removeRecord()
Remove a record from the DataSet's internal storage
DataSet::reset()
Essentially the same as releaseRecords, but it won't work on a QueryDataSet that has been created with a ResultSet
DataSet::resultSet()
Gets the ResultSet for this DataSet
DataSet::schema()
Gets the Schema for this DataSet
DataSet::setAllRecordsRetrieved()
Set all records retrieved
DataSet::size()
Gets the number of Records in this DataSet. It is 0 based.
DataSet::__toString()
This returns a represention of this DataSet

Class Details

[line 46]
This class is used to represent the results of a SQL select statements on the database.

It should not be used for doing modifications via update/delete/insert statements. If you would like to perform those functions, please use a TableDataSet.

  1. $qds = new QueryDataSet($conn, "SELECT * from my_table");
  2. $qds->fetchRecords(10); // fetch the first 10 records
  3. foreach($qds as $rec) {
  4. $value = $rec->getValue("column");
  5. }
  6. $qds->close();




Tags:

version:  $Revision: 1.3 $
author:  Jon S. Stevens <jon@latchkey.com> (Village)
author:  Hans Lellelid <hans@xmpl.org> (Jargon)


[ Top ]


Class Methods


constructor __construct [line 58]

QueryDataSet __construct( mixed $p1, [mixed $selectSql = null], string $selectStmt)

Creates a new QueryDataSet based on a connection and a select string

This class can be instantiated with a couple signatures:

  • new QueryDataSet($conn, "SELECT * FROM mytable");
  • new QueryDataSet($rs);




Tags:

access:  public


Parameters:

mixed   $p1   Connecton or ResultSet (depending on signature)
string   $selectStmt   SELECT SQL (only if $p1 is Connection)

[ Top ]

method getSelectSql [line 73]

a getSelectSql( )

get the Select String that was used to create this QueryDataSet



Tags:

return:  select string
access:  public


Overrides DataSet::getSelectSql() (Classes extending this class must implement this method.)

[ Top ]


Documentation generated on Mon, 23 Aug 2004 21:52:54 -0400 by phpDocumentor 1.3.0RC3