Common interface for document storage services in the cloud. This interface supports most document services and provides some flexibility for vendor-specific features and requirements via an optional $options array in each method signature. Classes implementing this interface should implement URI construction for collections and documents from the parameters given in each method and the account data passed in to the constructor. Classes implementing this interface are also responsible for security; access control isn't currently supported in this interface, although we are considering access control support in future versions of the interface.

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

Create collection.

createCollection(string $name, array $options = null) : array

Parameters

$name

string

$options

array

Returns

array

Delete collection.

deleteCollection(string $name, array $options = null) : void

Parameters

$name

string

$options

array

Delete document

deleteDocument(string $collectionName, mixed $documentID, array $options = null) : void

Parameters

$collectionName

string

Collection name

$documentID

mixed

Document ID, adapter-dependent

$options

array

Fetch single document by ID

fetchDocument(string $collectionName, mixed $documentID, array $options = null) : \Zend_Cloud_DocumentService_Document

Will return false if the document does not exist

Parameters

$collectionName

string

Collection name

$documentID

mixed

Document ID, adapter-dependent

$options

array

Returns

\Zend_Cloud_DocumentService_Document

Get the concrete service client

getClient() 

Insert document

insertDocument(string $collectionName, \Zend_Cloud_DocumentService_Document $document, array $options = null) : boolean

Parameters

$collectionName

string

Collection name

$document

\Zend_Cloud_DocumentService_Document

Document to insert

$options

array

Returns

boolean

List collections.

listCollections(array $options = null) : array

Parameters

$options

array

Returns

arrayList of collection names

List all documents in a collection

listDocuments(string $collectionName, null|array $options = null) : \Zend_Cloud_DocumentService_DocumentSet

Parameters

$collectionName

string

$options

nullarray

Returns

\Zend_Cloud_DocumentService_DocumentSet

Query for documents stored in the document service. If a string is passed in $query, the query string will be passed directly to the service.

query(string $collectionName, string $query, array $options = null) : array

Parameters

$collectionName

string

Collection name

$query

string

$options

array

Returns

arrayArray of field sets

Replace document The new document replaces the existing document with the same ID.

replaceDocument(string $collectionName, \Zend_Cloud_DocumentService_Document $document, array $options = null

Parameters

$collectionName

string

Collection name

$document

\Zend_Cloud_DocumentService_Document

$options

array

Create query statement

select(string $fields = null) : \Zend_Cloud_DocumentService_Query

Parameters

$fields

string

Returns

\Zend_Cloud_DocumentService_Query

Update document The fields of the existing documents will be updated.

updateDocument(string $collectionName, mixed|\Zend_Cloud_DocumentService_Document $documentID, array|\Zend_Cloud_DocumentService_Document $fieldset = null, array $options = null) : boolean

Fields not specified in the set will be left as-is.

Parameters

$collectionName

string

$documentID

mixed\Zend_Cloud_DocumentService_Document

Document ID, adapter-dependent, or document containing updates

$fieldset

array\Zend_Cloud_DocumentService_Document

Set of fields to update

$options

array

Returns

boolean

 Constants

 

HTTP_ADAPTER

HTTP_ADAPTER = 'http_adapter'