Cloud/DocumentService/Adapter.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-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Cloud
- Subpackage
- DocumentService
\Zend_Cloud_DocumentService_Adapter
Package: Zend_Cloud\DocumentService
Returns
Returns
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
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Methods
createCollection(string $name, array $options = null) : array
Create collection.
Parameters
Returns
Name | Type | Description |
---|---|---|
$name | string | |
$options | array |
Type | Description |
---|---|
array |
deleteCollection(string $name, array $options = null) : void
Delete collection.
Parameters
Name | Type | Description |
---|---|---|
$name | string | |
$options | array |
deleteDocument(string $collectionName, mixed $documentID, array $options = null) : void
Delete document
Parameters
Name | Type | Description |
---|---|---|
$collectionName | string | Collection name |
$documentID | mixed | Document ID, adapter-dependent |
$options | array |
fetchDocument(string $collectionName, mixed $documentID, array $options = null) : \Zend_Cloud_DocumentService_Document
Fetch single document by ID
Will return false if the document does not exist
ParametersName | Type | Description |
---|---|---|
$collectionName | string | Collection name |
$documentID | mixed | Document ID, adapter-dependent |
$options | array |
Type | Description |
---|---|
\Zend_Cloud_DocumentService_Document |
insertDocument(string $collectionName, \Zend_Cloud_DocumentService_Document $document, array $options = null) : boolean
Insert document
Parameters
Returns
Name | Type | Description |
---|---|---|
$collectionName | string | Collection name |
$document | \Zend_Cloud_DocumentService_Document | Document to insert |
$options | array |
Type | Description |
---|---|
boolean |
listCollections(array $options = null) : array
List collections.
Parameters
Returns
Name | Type | Description |
---|---|---|
$options | array |
Type | Description |
---|---|
array | List of collection names |
listDocuments(string $collectionName, null | array $options = null) : \Zend_Cloud_DocumentService_DocumentSet
List all documents in a collection
Parameters
Returns
Name | Type | Description |
---|---|---|
$collectionName | string | |
$options | null | array |
Type | Description |
---|---|
\Zend_Cloud_DocumentService_DocumentSet |
query(string $collectionName, string $query, array $options = null) : array
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.
Parameters
Returns
Name | Type | Description |
---|---|---|
$collectionName | string | Collection name |
$query | string | |
$options | array |
Type | Description |
---|---|
array | Array of field sets |
replaceDocument(string $collectionName, \Zend_Cloud_DocumentService_Document $document, array $options = null) : void
Replace document The new document replaces the existing document with the same ID.
Parameters
Name | Type | Description |
---|---|---|
$collectionName | string | Collection name |
$document | \Zend_Cloud_DocumentService_Document | |
$options | array |
select(string $fields = null) : \Zend_Cloud_DocumentService_Query
Create query statement
Parameters
Returns
Name | Type | Description |
---|---|---|
$fields | string |
Type | Description |
---|---|
\Zend_Cloud_DocumentService_Query |
updateDocument(string $collectionName, mixed | \Zend_Cloud_DocumentService_Document $documentID, array | \Zend_Cloud_DocumentService_Document $fieldset = null, array $options = null) : boolean
Update document The fields of the existing documents will be updated.
Fields not specified in the set will be left as-is.
ParametersName | Type | Description |
---|---|---|
$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 |
Type | Description |
---|---|
boolean |