Query returning values from a (static) array as rows.
This is a simple non-db query. When created, it is passed an array of arrays (data array). It does not support conditions, order, etc. The only two functions it implements are search(), which resets the data array, and nextRecord(), which fetches next element from the data array and returns it.
So the data array should look like: $data = array( array( "id" => 1, "name" => "Element 1", "note" => "Test element" ), array( "id" => 2, "name" => "Element 2", "note" => "Test element" ), ... )
This class can be used in places where a query is required and where you want the query to return a "custom" set of rows. You may, e.g., fetch the data from the database, do some complicated processing and then create a DBLArrayQuery object and pass it to DBLView::detail(). (Or you may make new class as a subclass of the database class you use, e.g., DBLMYSQLQuery and override the nextRecord() method to modify records. This solution is a bit cleaner.)
The other purpose of this class is to serve as an example of custom query. Similar way, you could create a query to return data stored in a file.
Located in /DBLArrayQuery.php (line 37)
DBLQuery | --DBLArrayQuery
Inherited from DBLQuery
DBLQuery::$conditions
DBLQuery::$def
DBLQuery::$fields
DBLQuery::$offset
DBLQuery::$orderDef
DBLQuery::$orderReferse
DBLQuery::$records
DBLQuery::$srcDef
DBLQuery::$values
Constructor.
Get next "record" - next array element.
"Start searching".
For this class, it means reseting the array so we start getting the rows from the beginning.
Inherited From DBLQuery
DBLQuery::DBLQuery()
DBLQuery::addCondition()
DBLQuery::addRecord()
DBLQuery::addValue()
DBLQuery::clearConditions()
DBLQuery::clearValues()
DBLQuery::deleteRecord()
DBLQuery::formatDateTime()
DBLQuery::getDefaultDateTime()
DBLQuery::isEmptyDateTime()
DBLQuery::modifyRecord()
DBLQuery::nextRecord()
DBLQuery::parseDateTime()
DBLQuery::reset()
DBLQuery::search()
DBLQuery::setFields()
DBLQuery::setLimit()
DBLQuery::setOrder()
DBLQuery::setSource()
Documentation generated on Mon, 6 Sep 2004 21:57:00 +0200 by phpDocumentor 1.2.3