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

__construct(
string|null $identifier
=
null, array|\Traversable|null $items
=
null, string|null $label
=
null
)
:
void
Constructor
Name | Type | Description |
---|---|---|
$identifier | string|null | |
$items | array|\Traversable|null | |
$label | string|null |

__toString(
)
:
string
Serialize to string (proxy to {@link toJson()})
Type | Description |
---|---|
string |

_normalizeItem(
array|object $item, string|int|null $id
)
:
array
Normalize an item to attach to the collection
Name | Type | Description |
---|---|---|
$item | array|object | |
$id | string|int|null |
Type | Description |
---|---|
array |

addItem(
array|object $item, string|null $id
=
null
)
:
\Zend_Dojo_Data
Add an individual item, optionally by identifier
Name | Type | Description |
---|---|---|
$item | array|object | |
$id | string|null |
Type | Description |
---|---|
\Zend_Dojo_Data |

getIdentifier(
)
:
string|int|null
Retrieve current item identifier
Type | Description |
---|---|
stringintnull |

getItem(
string $id
)
:
array
Retrieve an item by identifier
Item retrieved will be flattened to an array.
Name | Type | Description |
---|---|---|
$id | string |
Type | Description |
---|---|
array |

getItems(
)
:
array
Get all items as an array
Serializes items to arrays.
Type | Description |
---|---|
array |

getMetadata(
null|string $key
=
null
)
:
mixed
Get metadata item or all metadata
Name | Type | Description |
---|---|---|
$key | null|string | Metadata key when pulling single metadata item |
Type | Description |
---|---|
mixed |

hasItem(
string|int $id
)
:
bool
Does an item with the given identifier exist?
Name | Type | Description |
---|---|---|
$id | string|int |
Type | Description |
---|---|
bool |

offsetExists(
string|int $offset
)
:
bool
ArrayAccess: does offset exist?
Name | Type | Description |
---|---|---|
$offset | string|int |
Type | Description |
---|---|
bool |

offsetGet(
string|int $offset
)
:
array
ArrayAccess: retrieve by offset
Name | Type | Description |
---|---|---|
$offset | string|int |
Type | Description |
---|---|
array |

offsetSet(
string $offset, array|object|null $value
)
:
void
ArrayAccess: set value by offset
Name | Type | Description |
---|---|---|
$offset | string | |
$value | array|object|null |

offsetUnset(
string $offset
)
:
void
ArrayAccess: unset value by offset
Name | Type | Description |
---|---|---|
$offset | string |

setIdentifier(
string|int|null $identifier
)
:
\Zend_Dojo_Data
Set identifier for item lookups
Name | Type | Description |
---|---|---|
$identifier | string|int|null |
Type | Description |
---|---|
\Zend_Dojo_Data |

setItem(
array|object $item, $id
=
null
)
:
\Zend_Dojo_Data
Set an individual item, optionally by identifier (overwrites)

setMetadata(
string|array $spec, mixed $value
=
null
)
:
\Zend_Dojo_Data
Set metadata by key or en masse
Name | Type | Description |
---|---|---|
$spec | string|array | |
$value | mixed |
Type | Description |
---|---|
\Zend_Dojo_Data |

toArray(
)
:
array
Seralize entire data structure, including identifier and label, to array
Type | Description |
---|---|
array |