Cloud/DocumentService/Document.php

Show: PublicProtectedPrivateinherited
Table of Contents
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.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Cloud  
Subpackage
DocumentService  

\Zend_Cloud_DocumentService_Document

Package: Zend_Cloud\DocumentService
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?
Implements
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  KEY_FIELD = '_id'
key in document denoting identifier

Properties

>VPropertyprotectedarray $_fields
Name/value array of field names to values.
Details
Type
array
>VPropertyprotectedmixed $_id
ID of this document.
Details
Type
mixed

Methods

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

Overloading: retrieve and set fields by name

Parameters
NameTypeDescription
$namestring
$argsmixed
Returns
TypeDescription
mixed
methodpublic__construct(array $fields, mixed $id = null) : void

Construct an instance of Zend_Cloud_DocumentService_Document.

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
NameTypeDescription
$fieldsarray
$idmixed

Document identifier

methodpublic__get(string $name) : mixed

Overloading: get value

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
mixed
methodpublic__set(string $name, mixed $value) : void

Overloading: set field

Parameters
NameTypeDescription
$namestring
$valuemixed
methodpubliccount() : int

Countable: return count of fields in document

Returns
TypeDescription
int
methodpublicgetField(string $name) : mixed

Get field by name.

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
mixed
methodpublicgetFields() : array

Get fields as array.

Returns
TypeDescription
array
methodpublicgetId() : string

Get ID name.

Returns
TypeDescription
string
methodpublicgetIterator() : \Iterator

IteratorAggregate: return iterator for iterating over fields

Returns
TypeDescription
\Iterator
methodpublicoffsetExists(string $name) : bool

ArrayAccess: does field exist?

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
bool
methodpublicoffsetGet(string $name) : mixed

ArrayAccess: get field by name

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
mixed
methodpublicoffsetSet(string $name, mixed $value) : void

ArrayAccess: set field to value

Parameters
NameTypeDescription
$namestring
$valuemixed
methodpublicoffsetUnset(string $name) : void

ArrayAccess: remove field from document

Parameters
NameTypeDescription
$namestring
methodpublicsetField(string $name, mixed $value) : \Zend_Cloud_DocumentService_Document

Set field by name.

Parameters
NameTypeDescription
$namestring
$valuemixed
Returns
TypeDescription
\Zend_Cloud_DocumentService_Document
methodpublicsetId(mixed $id) : \Zend_Cloud_DocumentService_Document

Set document identifier

Parameters
NameTypeDescription
$idmixed
Returns
TypeDescription
\Zend_Cloud_DocumentService_Document
Documentation was generated by phpDocumentor 2.2.0 .