Zend Framework
1.12
|
Public Member Functions | |
__construct ($identifier=null, $items=null, $label=null) | |
Constructor. | |
setItems ($items) | |
Set the items to collect. | |
setItem ($item, $id=null) | |
Set an individual item, optionally by identifier (overwrites) | |
addItem ($item, $id=null) | |
Add an individual item, optionally by identifier. | |
addItems ($items) | |
Add multiple items at once. | |
getItems () | |
Get all items as an array. | |
hasItem ($id) | |
Does an item with the given identifier exist? | |
getItem ($id) | |
Retrieve an item by identifier. | |
removeItem ($id) | |
Remove item by identifier. | |
clearItems () | |
Remove all items at once. | |
setIdentifier ($identifier) | |
Set identifier for item lookups. | |
getIdentifier () | |
Retrieve current item identifier. | |
setLabel ($label) | |
Set label to use for displaying item associations. | |
getLabel () | |
Retrieve item association label. | |
setMetadata ($spec, $value=null) | |
Set metadata by key or en masse. | |
getMetadata ($key=null) | |
Get metadata item or all metadata. | |
clearMetadata ($key=null) | |
Clear individual or all metadata item(s) | |
fromArray (array $data) | |
Load object from array. | |
fromJson ($json) | |
Load object from JSON. | |
toArray () | |
Seralize entire data structure, including identifier and label, to array. | |
toJson () | |
Serialize to JSON (dojo.data format) | |
__toString () | |
Serialize to string (proxy to toJson()) | |
offsetExists ($offset) | |
ArrayAccess: does offset exist? | |
offsetGet ($offset) | |
ArrayAccess: retrieve by offset. | |
offsetSet ($offset, $value) | |
ArrayAccess: set value by offset. | |
offsetUnset ($offset) | |
ArrayAccess: unset value by offset. | |
current () | |
Iterator: get current value. | |
key () | |
Iterator: get current key. | |
next () | |
Iterator: get next item. | |
rewind () | |
Iterator: rewind to first value in collection. | |
valid () | |
Iterator: is item valid? | |
count () | |
Countable: how many items are present. | |
Protected Member Functions | |
_normalizeItem ($item, $id) | |
Normalize an item to attach to the collection. | |
Protected Attributes | |
$_identifier | |
$_items = array() | |
$_label | |
$_metadata = array() | |
__construct | ( | $identifier = null , |
|
$items = null , |
|||
$label = null |
|||
) |
Constructor.
string | null | $identifier | |
array | Traversable | null | $items | |
string | null | $label |
__toString | ( | ) |
Serialize to string (proxy to toJson())
|
protected |
Normalize an item to attach to the collection.
array | object | $item | |
string | int | null | $id |
addItem | ( | $item, | |
$id = null |
|||
) |
Add an individual item, optionally by identifier.
array | object | $item | |
string | null | $id |
addItems | ( | $items | ) |
clearItems | ( | ) |
Remove all items at once.
clearMetadata | ( | $key = null | ) |
count | ( | ) |
Countable: how many items are present.
current | ( | ) |
Iterator: get current value.
fromArray | ( | array | $data | ) |
fromJson | ( | $json | ) |
getIdentifier | ( | ) |
Retrieve current item identifier.
getItem | ( | $id | ) |
Retrieve an item by identifier.
Item retrieved will be flattened to an array.
string | $id |
getItems | ( | ) |
Get all items as an array.
Serializes items to arrays.
getLabel | ( | ) |
Retrieve item association label.
getMetadata | ( | $key = null | ) |
Get metadata item or all metadata.
null | string | $key | Metadata key when pulling single metadata item |
hasItem | ( | $id | ) |
Does an item with the given identifier exist?
string | int | $id |
key | ( | ) |
Iterator: get current key.
next | ( | ) |
Iterator: get next item.
offsetExists | ( | $offset | ) |
ArrayAccess: does offset exist?
string | int | $offset |
offsetGet | ( | $offset | ) |
ArrayAccess: retrieve by offset.
string | int | $offset |
offsetSet | ( | $offset, | |
$value | |||
) |
ArrayAccess: set value by offset.
string | $offset | |
array | object | null | $value |
offsetUnset | ( | $offset | ) |
ArrayAccess: unset value by offset.
string | $offset |
removeItem | ( | $id | ) |
rewind | ( | ) |
Iterator: rewind to first value in collection.
setIdentifier | ( | $identifier | ) |
setItem | ( | $item, | |
$id = null |
|||
) |
Set an individual item, optionally by identifier (overwrites)
array | object | $item | |
string | null | $identifier |
setItems | ( | $items | ) |
setLabel | ( | $label | ) |
Set label to use for displaying item associations.
string | null | $label |
setMetadata | ( | $spec, | |
$value = null |
|||
) |
toArray | ( | ) |
Seralize entire data structure, including identifier and label, to array.
toJson | ( | ) |
Serialize to JSON (dojo.data format)
valid | ( | ) |
Iterator: is item valid?
|
protected |
|
protected |
|
protected |
|
protected |