Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
dojo.data support for Zend Framework
string|int $_identifier = ''
Identifier field of item
array $_items = 'array'
Collected items
string $_label = ''
Label field of item
array $_metadata = 'array'
Data container metadata
__construct(
string|null $identifier
=
null, array|Traversable|null $items
=
null, string|null $label
=
null
)
:
void
Constructor
__toString(
)
:
string
Serialize to string (proxy to {@link toJson()})
_normalizeItem(
array|object $item, string|int|null $id
)
:
array
Normalize an item to attach to the collection
addItem(
array|object $item, string|null $id
=
null
)
:
Zend_Dojo_Data
Add an individual item, optionally by identifier
addItems(
array|Traversable $items
)
:
Zend_Dojo_Data
Add multiple items at once
clearItems(
)
:
Zend_Dojo_Data
Remove all items at once
clearMetadata(
null|string $key
=
null
)
:
Zend_Dojo_Data
Clear individual or all metadata item(s)
count(
)
:
int
Countable: how many items are present
current(
)
:
array
Iterator: get current value
fromArray(
array $data
)
:
Zend_Dojo_Data
Load object from array
fromJson(
string $json
)
:
Zend_Dojo_Data
Load object from JSON
getIdentifier(
)
:
string|int|null
Retrieve current item identifier
getItem(
string $id
)
:
array
Retrieve an item by identifier
Item retrieved will be flattened to an array.
getItems(
)
:
array
Get all items as an array
Serializes items to arrays.
getLabel(
)
:
string|null
Retrieve item association label
getMetadata(
null|string $key
=
null
)
:
mixed
Get metadata item or all metadata
hasItem(
string|int $id
)
:
bool
Does an item with the given identifier exist?
key(
)
:
string|int
Iterator: get current key
next(
)
:
void
Iterator: get next item
offsetExists(
string|int $offset
)
:
bool
ArrayAccess: does offset exist?
offsetGet(
string|int $offset
)
:
array
ArrayAccess: retrieve by offset
offsetSet(
string $offset, array|object|null $value
)
:
void
ArrayAccess: set value by offset
offsetUnset(
string $offset
)
:
void
ArrayAccess: unset value by offset
removeItem(
string $id
)
:
Zend_Dojo_Data
Remove item by identifier
rewind(
)
:
void
Iterator: rewind to first value in collection
setIdentifier(
string|int|null $identifier
)
:
Zend_Dojo_Data
Set identifier for item lookups
setItem(
array|object $item, $id
=
null
)
:
Zend_Dojo_Data
Set an individual item, optionally by identifier (overwrites)
setItems(
array|Traversable $items
)
:
Zend_Dojo_Data
Set the items to collect
setLabel(
string|null $label
)
:
Zend_Dojo_Data
Set label to use for displaying item associations
setMetadata(
string|array $spec, mixed $value
=
null
)
:
Zend_Dojo_Data
Set metadata by key or en masse
toArray(
)
:
array
Seralize entire data structure, including identifier and label, to array
toJson(
)
:
string
Serialize to JSON (dojo.data format)
valid(
)
:
bool
Iterator: is item valid?