API Documentation

Cloud/DocumentService/Document.php

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-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Cloud  
subpackage
DocumentService  

\Zend_Cloud_DocumentService_Document

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-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Cloud  
subpackage
DocumentService  

Constants

Constant  KEY_FIELD = '_id'

key in document denoting identifier

Properties

Propertyprotectedarray  $_fields= ''

Name/value array of field names to values.

Details
Type
array
Propertyprotectedmixed  $_id= ''

ID of this document.

Details
Type
mixed

Methods

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

Overloading: retrieve and set fields by name

Parameters
Name Type Description
$name string
$args mixed
Returns
Type Description
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
Name Type Description
$fields array
$id mixed Document identifier
methodpublic__get( string $name ) : mixed

Overloading: get value

Parameters
Name Type Description
$name string
Returns
Type Description
mixed
methodpublic__set( string $name, mixed $value ) : void

Overloading: set field

Parameters
Name Type Description
$name string
$value mixed
methodpubliccount( ) : int

Countable: return count of fields in document

Returns
Type Description
int
methodpublicgetField( string $name ) : mixed

Get field by name.

Parameters
Name Type Description
$name string
Returns
Type Description
mixed
methodpublicgetFields( ) : array

Get fields as array.

Returns
Type Description
array
methodpublicgetId( ) : string

Get ID name.

Returns
Type Description
string
methodpublicgetIterator( ) : \Iterator

IteratorAggregate: return iterator for iterating over fields

Returns
Type Description
\Iterator
methodpublicoffsetExists( string $name ) : bool

ArrayAccess: does field exist?

Parameters
Name Type Description
$name string
Returns
Type Description
bool
methodpublicoffsetGet( string $name ) : mixed

ArrayAccess: get field by name

Parameters
Name Type Description
$name string
Returns
Type Description
mixed
methodpublicoffsetSet( string $name, mixed $value ) : void

ArrayAccess: set field to value

Parameters
Name Type Description
$name string
$value mixed
methodpublicoffsetUnset( string $name ) : void

ArrayAccess: remove field from document

Parameters
Name Type Description
$name string
methodpublicsetField( string $name, mixed $value ) : \Zend_Cloud_DocumentService_Document

Set field by name.

Parameters
Name Type Description
$name string
$value mixed
Returns
Type Description
\Zend_Cloud_DocumentService_Document
methodpublicsetId( mixed $id ) : \Zend_Cloud_DocumentService_Document

Set document identifier

Parameters
Name Type Description
$id mixed
Returns
Type Description
\Zend_Cloud_DocumentService_Document
Documentation was generated by DocBlox 0.13.3.