KWeb  6.4
Collection_Outer Class Reference

Outer collection for collection. More...

Inheritance diagram for Collection_Outer:
Collection Collection_Filtered KWebCollection_Objects KWebSearch_Result KWebCollection_Links

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

Detailed Description

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.


Constructor & Destructor Documentation

Collection_Outer::__construct ( Collection collection,
array $  options = array() 
)
Parameters:
$dataSource of the data
$objectGenreOrFieldObjects genre, or data field containing the genre prefixed with '.'
$objectIdFieldData field containing the object id or name

Reimplemented in KWebSearch_Result.


Member Function Documentation

Collection_Outer::close ( )

Closes the collection and frees up resources.

Reimplemented from Collection.

Collection_Outer::count ( )

Reimplemented in Collection_Filtered.

Collection_Outer::current ( )
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.

Returns:
mixed

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.

Returns:
mixed

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...

Returns:
Collection

Reimplemented from Collection.

Collection_Outer::getInnerIterator ( )
Returns:
Collection
Collection_Outer::isBidirectional ( )

Returns true if data can be traversed in both directions.

Returns:
boolean

Reimplemented from Collection.

Reimplemented in Collection_Filtered.

Collection_Outer::isHandlingData ( )

Returns true if this collection is handling data (overrides current(), fetchField(), or extractField())

Returns:
boolean

Reimplemented in KWebCollection_Objects.

Collection_Outer::next ( )

Moves to the next position.

Reimplemented from Collection.

Reimplemented in Collection_Filtered.

Collection_Outer::prefetch ( limit = false,
start = false 
)

Items will be prefetched (if needed) in a batch for later retrieval.

Parameters:
Numberof items to prefetch or false
Startof the prefetch or false for current position
Returns:
boolean TRUE if prefetch was successfull, FALSE if prefetch can't be supported

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

Returns:
boolean

Reimplemented from Collection.

Reimplemented in Collection_Filtered.


Field Documentation

Collection_Outer::$collection [protected]

The documentation for this class was generated from the following file: