Dojo/Data.php
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 [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
-
New BSD License
- Package
- Zend_Dojo
- Version
- $Id: Data.php 24593 2012-01-05 20:35:02Z matthew $
Package: Zend\Dojodojo.data support for Zend Framework
- Implements
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
-
New BSD License
- Uses
- \global\ArrayAccess
- Uses
- \global\Iterator
- Uses
- \global\Countable
Properties
Methods



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



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



addItems(array | \Traversable $items) : \Zend_Dojo_Data
Add multiple items at once
Parameters
Name |
Type |
Description |
$items |
array | \Traversable |
|
Returns



clearMetadata(null | string $key = null) : \Zend_Dojo_Data
Clear individual or all metadata item(s)
Parameters
Name |
Type |
Description |
$key |
null | string |
|
Returns



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



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



getItems() : array
Get all items as an array
Serializes items to arrays.
Returns



getLabel() : string | null
Retrieve item association label
Returns
Type |
Description |
string | null |
|



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



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



key() : string | int
Iterator: get current key
Returns
Type |
Description |
string | int |
|



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



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



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



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



removeItem(string $id) : \Zend_Dojo_Data
Remove item by identifier
Parameters
Name |
Type |
Description |
$id |
string |
|
Returns



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



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



setLabel(string | null $label) : \Zend_Dojo_Data
Set label to use for displaying item associations
Parameters
Name |
Type |
Description |
$label |
string | null |
|
Returns



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