KWeb
6.4
|
Objects (KWebObject) read from another data source. More...
Public Member Functions | |
__construct (Collection $collection, $objectGenreOrField, $objectIdField, array $options=array()) | |
current () | |
prefetch ($limit=false, $start=false) | |
Items will be prefetched (if needed) in a batch for later retrieval. | |
extractField ($data, $field, $default=null) | |
isHandlingData () | |
Returns true if this collection is handling data (overrides current(), fetchField(), or extractField()) | |
Static Public Member Functions | |
static | createFromArray (array $data, array $options=array(), $objectGenreOrField=GENRE_ITEM, $objectIdField=false) |
Creates KWebCollection_Objects from array of ids, or array of arrays. | |
static | createFromObjects (array $data, array $options=array()) |
Creates KWebCollection_Objects from array of objects. | |
Data Fields | |
$objectIdField = "" | |
Field name in data with object's id, or false to use data as an id. | |
$objectGenreField | |
Field name in data with object's genre, or false to use $objectGenre. | |
$objectGenre | |
Objects genre, FALSE to treat object IDs as UIDs, or NULL if data is itself an KWebObject. | |
Protected Attributes | |
$lastPrefetched = 0 | |
$lastReleased = 0 |
Objects (KWebObject) read from another data source.
supports OPT_PREFETCH_AUTO and OPT_RELEASE_AUTO
KWebCollection_Objects::__construct | ( | Collection $ | collection, |
$ | objectGenreOrField, | ||
$ | objectIdField, | ||
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 |
static KWebCollection_Objects::createFromArray | ( | array $ | data, |
array $ | options = array() , |
||
$ | objectGenreOrField = GENRE_ITEM , |
||
$ | objectIdField = false |
||
) | [static] |
Creates KWebCollection_Objects from array of ids, or array of arrays.
// create from UIDs: KWebCollection_Objects::createFromArray(array('1,item', '2,comment'), array(), false, false);
// create from IDs: KWebCollection_Objects::createFromArray(array('1', '2'), array(), GENRE_ITEM, false);
// create from array of arrays: KWebCollection_Objects::createFromArray(array(array('genre' => 'item', 'id' => '1'), array('genre' => 'comment', 'id' => '2')), array(), '.genre', 'id');
$objectGenreOrField | - object genre, object genre's field name prefixed with '.', or FALSE to treat id as UID |
$objectIdField | - object id's field name, or FALSE to treat data as id |
static KWebCollection_Objects::createFromObjects | ( | array $ | data, |
array $ | options = array() |
||
) | [static] |
Creates KWebCollection_Objects from array of objects.
KWebCollection_Objects::current | ( | ) |
Reimplemented from Collection_Outer.
KWebCollection_Objects::extractField | ( | $ | data, |
$ | field, | ||
$ | default = null |
||
) |
KWebObject | $data |
Reimplemented from Collection_Outer.
KWebCollection_Objects::isHandlingData | ( | ) |
Returns true if this collection is handling data (overrides current(), fetchField(), or extractField())
Reimplemented from Collection_Outer.
KWebCollection_Objects::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.
Reimplemented in KWebCollection_Links.
KWebCollection_Objects::$lastPrefetched = 0 [protected] |
KWebCollection_Objects::$lastReleased = 0 [protected] |
KWebCollection_Objects::$objectGenre |
Objects genre, FALSE to treat object IDs as UIDs, or NULL if data is itself an KWebObject.
KWebCollection_Objects::$objectGenreField |
Field name in data with object's genre, or false to use $objectGenre.
KWebCollection_Objects::$objectIdField = "" |
Field name in data with object's id, or false to use data as an id.