KWeb
6.4
|
Outer collection for collection. More...
Public Member Functions | |
__construct (Collection $collection, array $options=array()) | |
count () | |
current () | |
next () | |
Moves to the next position. | |
currentPosition () | |
Returns current position in the set. | |
valid () | |
Returns item at current position, staying at the current position. | |
seek ($pos) | |
prefetch ($limit=false, $start=false) | |
Items will be prefetched (if needed) in a batch for later retrieval. | |
isBidirectional () | |
Returns true if data can be traversed in both directions. | |
close () | |
Closes the collection and frees up resources. | |
getCollection ($className=false) | |
Returns inner collection, or if you specify $className this, or any inner collection of this classname... | |
getInnerIterator () | |
extractField ($data, $field, $default=null) | |
Extracts specified field from data object/value. | |
fetchField ($field, $moveNext=true, $default=null) | |
Returns field of an item at current position. | |
isHandlingData () | |
Returns true if this collection is handling data (overrides current(), fetchField(), or extractField()) | |
sync () | |
Synchronizes inner and outer collections. | |
Protected Attributes | |
$collection |
Outer collection for collection.
Rather a base class for other collections.
By default, this class passes fetchField to the inner collection, unless there is OPT_FIELD_EXTRACTOR. If this class's descendant has its own extractField, it should also override isHandlingData and return true.
Collection_Outer::__construct | ( | Collection $ | collection, |
array $ | options = array() |
||
) |
$data | Source of the data |
$objectGenreOrField | Objects genre, or data field containing the genre prefixed with '.' |
$objectIdField | Data field containing the object id or name |
Reimplemented in KWebSearch_Result.
Collection_Outer::close | ( | ) |
Closes the collection and frees up resources.
Reimplemented from Collection.
Collection_Outer::count | ( | ) |
Reimplemented in Collection_Filtered.
Collection_Outer::current | ( | ) |
Reimplemented in Collection_Filtered, and KWebCollection_Objects.
Collection_Outer::currentPosition | ( | ) |
Returns current position in the set.
Reimplemented from Collection.
Reimplemented in Collection_Filtered.
Collection_Outer::extractField | ( | $ | data, |
$ | field, | ||
$ | default = null |
||
) |
Extracts specified field from data object/value.
Reimplemented from Collection.
Reimplemented in KWebCollection_Objects.
Collection_Outer::fetchField | ( | $ | field, |
$ | moveNext = true , |
||
$ | default = null |
||
) |
Returns field of an item at current position.
On some Collection_Outer collections, You can prepend INNER_FIELD (like: fetchField('.field')) to the field name, to access fields of the inner collection. To access inner collection's value (same as using fetch()), use INNER_FIELD only (like: fetchField('.')). You can go several levels deep this way, but general rule of a thumb is, that if the collection doesn't handle the data (eg. Collection_Filtered), it can be considered as at the same level, as the one that handles underneath it.
Reimplemented from Collection.
Collection_Outer::getCollection | ( | $ | className = false | ) |
Returns inner collection, or if you specify $className this, or any inner collection of this classname...
This allows to search for a specific collection in the collection chain...
Reimplemented from Collection.
Collection_Outer::getInnerIterator | ( | ) |
Collection_Outer::isBidirectional | ( | ) |
Returns true if data can be traversed in both directions.
Reimplemented from Collection.
Reimplemented in Collection_Filtered.
Collection_Outer::isHandlingData | ( | ) |
Returns true if this collection is handling data (overrides current(), fetchField(), or extractField())
Reimplemented in KWebCollection_Objects.
Collection_Outer::next | ( | ) |
Collection_Outer::prefetch | ( | $ | limit = false , |
$ | start = false |
||
) |
Items will be prefetched (if needed) in a batch for later retrieval.
Number | of items to prefetch or false |
Start | of the prefetch or false for current position |
Reimplemented from Collection.
Reimplemented in Collection_Filtered, KWebCollection_Objects, and KWebCollection_Links.
Collection_Outer::seek | ( | $ | pos | ) |
Reimplemented in Collection_Filtered.
Collection_Outer::sync | ( | ) |
Synchronizes inner and outer collections.
Reimplemented in Collection_Filtered.
Collection_Outer::valid | ( | ) |
Returns item at current position, staying at the current position.
Returns true if there is data at current possition
Reimplemented from Collection.
Reimplemented in Collection_Filtered.
Collection_Outer::$collection [protected] |