Data read from DB query result.
More...
Detailed Description
Data read from DB query result.
Constructor & Destructor Documentation
Collection_Query::__construct |
( |
KDB_Driver $ |
db, |
|
|
$ |
result, |
|
|
$ |
query = null , |
|
|
array $ |
options = array() |
|
) |
| |
- Parameters:
-
$db | Database to read from. If null, $query object will be used to query the database when needed |
$result | Query result object. If null, $query object will be used to query the database when needed |
Member Function Documentation
Collection_Query::close |
( |
| ) |
|
Closes the collection and frees up resources.
Reimplemented from Collection.
Collection_Query::count |
( |
| ) |
|
Collection_Query::current |
( |
| ) |
|
Collection_Query::currentPosition |
( |
| ) |
|
Returns current position in the set.
Reimplemented from Collection.
Collection_Query::getDb |
( |
| ) |
|
Collection_Query::getQuery |
( |
| ) |
|
Collection_Query::getQueryResult |
( |
| ) |
|
Collection_Query::hasField |
( |
$ |
field | ) |
|
- Returns:
- boolean true if collection contains this field
Reimplemented from Collection.
Collection_Query::isBidirectional |
( |
| ) |
|
Returns true if data can be traversed in both directions.
- Returns:
- boolean
Reimplemented from Collection.
Collection_Query::isCached |
( |
| ) |
|
Returns true if whole response is cached.
Collection_Query::isQueryExecuted |
( |
| ) |
|
Returns true if query was already executed.
Collection_Query::next |
( |
| ) |
|
Moves to the next position.
Reimplemented from Collection.
Collection_Query::prefetch |
( |
$ |
limit = false , |
|
|
$ |
start = false |
|
) |
| |
Items will be prefetched (if needed) in a batch for later retrieval.
- Parameters:
-
Number | of items to prefetch or false |
Start | of the prefetch or false for current position |
- Returns:
- boolean TRUE if prefetch was successfull, FALSE if prefetch can't be supported
Reimplemented from Collection.
Collection_Query::seek |
( |
$ |
pos | ) |
|
Collection_Query::setQuery |
( |
$ |
query | ) |
|
Changes the query.
If the query was already executed, nothing will really happen.
Collection_Query::valid |
( |
| ) |
|
Returns item at current position, staying at the current position.
Returns true if there is data at current possition
- Returns:
- boolean
Reimplemented from Collection.
Field Documentation
Collection_Query::$cached = array() [protected] |
Collection_Query::$currentFetch = null [protected] |
Collection_Query::$dataPosition = 0 [protected] |
Collection_Query::$db [protected] |
Collection_Query::$position = 0 [protected] |
Collection_Query::$query [protected] |
Collection_Query::$requeryOnRewind = true |
As database reading is not bidirectional, it's impossible to go back in the results without caching.
Therefore to go back in the results it's possible to run query once again. As it's a performance penalty, every time it happens a E_USER_NOTICE will be triggered.
Collection_Query::$result [protected] |
Options to pass to KDB::query.
The documentation for this class was generated from the following file: