Class encapsulating documents. Fields are stored in a name/value array. Data are represented as strings.

TODO Can fields be large enough to warrant support for streams?

category Zend
package Zend_Cloud
subpackage DocumentService
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Overloading: retrieve and set fields by name

__call(string $name, mixed $args) : mixed

Parameters

$name

string

$args

mixed

Returns

mixed

Construct an instance of Zend_Cloud_DocumentService_Document.

__construct(array $fields, mixed $id = null) : void

If no identifier is provided, but a field matching KEY_FIELD is present, then that field's value will be used as the document identifier.

Parameters

$fields

array

$id

mixed

Document identifier

Overloading: get value

__get(string $name) : mixed

Parameters

$name

string

Returns

mixed

Overloading: set field

__set(string $name, mixed $value) : void

Parameters

$name

string

$value

mixed

Countable: return count of fields in document

count() : integer

Returns

integer

Get field by name.

getField(string $name) : mixed

Parameters

$name

string

Returns

mixed

Get fields as array.

getFields() : array

Returns

array

Get ID name.

getId() : string

Returns

string

IteratorAggregate: return iterator for iterating over fields

getIterator() : \Iterator

Returns

\Iterator

ArrayAccess: does field exist?

offsetExists(string $name) : boolean

Parameters

$name

string

Returns

boolean

ArrayAccess: get field by name

offsetGet(string $name) : mixed

Parameters

$name

string

Returns

mixed

ArrayAccess: set field to value

offsetSet(string $name, mixed $value) : void

Parameters

$name

string

$value

mixed

ArrayAccess: remove field from document

offsetUnset(string $name) : void

Parameters

$name

string

Set field by name.

setField(string $name, mixed $value) : \Zend_Cloud_DocumentService_Document

Parameters

$name

string

$value

mixed

Returns

\Zend_Cloud_DocumentService_Document

Set document identifier

setId(mixed $id) : \Zend_Cloud_DocumentService_Document

Parameters

$id

mixed

Returns

\Zend_Cloud_DocumentService_Document

 Properties

 

Name/value array of field names to values.

$_fields : array

Default

 

ID of this document.

$_id : mixed

Default

 Constants

 

key in document denoting identifier

KEY_FIELD = '_id'