KWeb
6.4
|
Data filtered by custom callbacks. More...
Public Member Functions | |
__construct (Collection $collection, array $filters, array $options=array()) | |
getDataPositions () | |
Returns data positions. | |
count () | |
getFailedCount () | |
filterData ($limit, $start=false) | |
Filters the data. | |
current () | |
next () | |
Moves to the next position. | |
currentPosition () | |
Returns current position in the set. | |
currentSeekablePosition () | |
Returns position that can be seeked to on re-query, to get to the same result. | |
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. | |
sync () | |
Synchronizes inner and outer collections. | |
Data Fields | |
$filteredCount = false | |
Enables filtering when counting results. | |
$filteredSeek = false | |
Enables filtering when seeking to new positions. | |
$maxFailedMatches = false | |
Maximum number of failed matches, after which to stop searching. | |
$prefetchOverhead = 1.1 | |
How much more items should be prefetched? | |
$filters | |
List of filters to match. | |
Protected Member Functions | |
checkAutoPrefetch () | |
Protected Attributes | |
$position = 0 | |
$positions = array() | |
$cache = array() | |
$lastPosition = null | |
Last position if the last item was retrieved from data. | |
$count = null | |
$failedCount = 0 | |
$seekedDataPosition = null |
Data filtered by custom callbacks.
supports OPT_PREFETCH_AUTO and OPT_RELEASE_AUTO
Collection_Filtered::__construct | ( | Collection $ | collection, |
array $ | filters, | ||
array $ | options = array() |
||
) |
Collection_Filtered::checkAutoPrefetch | ( | ) | [protected] |
Collection_Filtered::count | ( | ) |
Reimplemented from Collection_Outer.
Collection_Filtered::current | ( | ) |
Reimplemented from Collection_Outer.
Collection_Filtered::currentPosition | ( | ) |
Returns current position in the set.
Reimplemented from Collection_Outer.
Collection_Filtered::currentSeekablePosition | ( | ) |
Returns position that can be seeked to on re-query, to get to the same result.
If collection doesn't use filteredSeek, this position will allow to restart collection from the same point without filtering data again.
Collection_Filtered::filterData | ( | $ | limit, |
$ | start = false |
||
) |
Filters the data.
This function ensures, that at least $limit items are filtered (counting only matched items) and stored in the cache.
$start | Position to start from (filtered position) |
Collection_Filtered::getDataPositions | ( | ) |
Returns data positions.
Collection_Filtered::getFailedCount | ( | ) |
Collection_Filtered::isBidirectional | ( | ) |
Returns true if data can be traversed in both directions.
Reimplemented from Collection_Outer.
Collection_Filtered::next | ( | ) |
Moves to the next position.
Reimplemented from Collection_Outer.
Collection_Filtered::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_Outer.
Collection_Filtered::seek | ( | $ | pos | ) |
Reimplemented from Collection_Outer.
Collection_Filtered::sync | ( | ) |
Synchronizes inner and outer collections.
Reimplemented from Collection_Outer.
Collection_Filtered::valid | ( | ) |
Returns item at current position, staying at the current position.
Returns true if there is data at current possition
Reimplemented from Collection_Outer.
Collection_Filtered::$cache = array() [protected] |
Collection_Filtered::$count = null [protected] |
Collection_Filtered::$failedCount = 0 [protected] |
Collection_Filtered::$filteredCount = false |
Enables filtering when counting results.
May be very resource intensive!
Collection_Filtered::$filteredSeek = false |
Enables filtering when seeking to new positions.
May be very resource intensive!
Collection_Filtered::$filters |
List of filters to match.
All filters must be valid, to accept the item
Collection_Filtered::$lastPosition = null [protected] |
Last position if the last item was retrieved from data.
It doesn't mean that everything was filtered!
Collection_Filtered::$maxFailedMatches = false |
Maximum number of failed matches, after which to stop searching.
Collection_Filtered::$position = 0 [protected] |
Collection_Filtered::$positions = array() [protected] |
Collection_Filtered::$prefetchOverhead = 1.1 |
How much more items should be prefetched?
Collection_Filtered::$seekedDataPosition = null [protected] |