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.
SimpleDB adapter for document service.

string
$_queryClass= ''Zend_Cloud_DocumentService_Adapter_SimpleDb_Query''
Class to utilize for new query objects
'Zend_Cloud_DocumentService_Adapter_SimpleDb_Query'
Details
__construct(
array|\Zend_Config $options
=
array()
)
:
void
Constructor
Name | Type | Description |
---|---|---|
$options | array|\Zend_Config |

_getDocumentFromArray(
array $document
)
:
\Zend_Cloud_DocumentService_Document
Create suitable document from array of fields
Name | Type | Description |
---|---|---|
$document | array |
Type | Description |
---|---|
\Zend_Cloud_DocumentService_Document |

_getDocumentSetFromResultSet(
\Zend_Service_Amazon_SimpleDb_Page $resultSet, bool $returnDocs
=
true
)
:
\Zend_Cloud_DocumentService_DocumentSet
Create a DocumentSet from a SimpleDb resultset
Name | Type | Description |
---|---|---|
$resultSet | \Zend_Service_Amazon_SimpleDb_Page | |
$returnDocs | bool |
Type | Description |
---|---|
\Zend_Cloud_DocumentService_DocumentSet |

_makeAttributes(
string $name, array $attributes
)
:
array
Convert array of key-value pairs to array of Amazon attributes
Name | Type | Description |
---|---|---|
$name | string | |
$attributes | array |
Type | Description |
---|---|
array |

_resolveAttributes(
array $attributes, $returnDocument
=
false
)
:
array
Convert array of Amazon attributes to array of key-value pairs
Name | Type | Description |
---|---|---|
$attributes | array | |
$returnDocument |
Type | Description |
---|---|
array |

createCollection(
string $name, array $options
=
null
)
:
void
Create collection.
Name | Type | Description |
---|---|---|
$name | string | |
$options | array |

deleteCollection(
string $name, array $options
=
null
)
:
void
Delete collection.
Name | Type | Description |
---|---|---|
$name | string | |
$options | array |

deleteDocument(
string $collectionName, mixed $document, array $options
=
null
)
:
boolean
Delete document.
Name | Type | Description |
---|---|---|
$collectionName | string | Collection from which to delete document |
$document | mixed | Document ID or Document object. |
$options | array |
Type | Description |
---|---|
boolean |

fetchDocument(
string $collectionName, mixed $documentId, array $options
=
null
)
:
\Zend_Cloud_DocumentService_Document
Fetch single document by ID
Name | Type | Description |
---|---|---|
$collectionName | string | Collection name |
$documentId | mixed | Document ID, adapter-dependent |
$options | array |
Type | Description |
---|---|
\Zend_Cloud_DocumentService_Document |

getClient(
)
:
\Zend_Service_Amazon_SimpleDb
Get the concrete service client
Type | Description |
---|---|
\Zend_Service_Amazon_SimpleDb |

insertDocument(
string $collectionName, array|\Zend_Cloud_DocumentService_Document $document, array $options
=
null
)
:
void
Insert document
Name | Type | Description |
---|---|---|
$collectionName | string | Collection into which to insert document |
$document | array|\Zend_Cloud_DocumentService_Document | |
$options | array |

listCollections(
array $options
=
null
)
:
array
List collections.
Name | Type | Description |
---|---|---|
$options | array |
Type | Description |
---|---|
array |

listDocuments(
string $collectionName, array|null $options
=
null
)
:
\Zend_Cloud_DocumentService_DocumentSet
List documents
Returns a key/value array of document names to document objects.
Name | Type | Description |
---|---|---|
$collectionName | string | Name of collection for which to list documents |
$options | array|null |
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.
Name | Type | Description |
---|---|---|
$collectionName | string | Collection name |
$query | string | |
$options | array |
Type | Description |
---|---|
array | Zend_Cloud_DocumentService_DocumentSet |

replaceDocument(
string $collectionName, array|\Zend_Cloud_DocumentService_Document $document, array $options
=
null
)
:
void
Replace an existing document with a new version
Name | Type | Description |
---|---|---|
$collectionName | string | |
$document | array|\Zend_Cloud_DocumentService_Document | |
$options | array |

select(
string $fields
=
null
)
:
\Zend_Cloud_DocumentService_Adapter_SimpleDb_Query
Create query statement
Name | Type | Description |
---|---|---|
$fields | string |
Type | Description |
---|---|
\Zend_Cloud_DocumentService_Adapter_SimpleDb_Query |

updateDocument(
string $collectionName, mixed|\Zend_Cloud_DocumentService_Document $documentId, array|\Zend_Cloud_DocumentService_Document $fieldset
=
null, array $options
=
null
)
:
boolean
Update document. The new document replaces the existing document.
Option 'merge' specifies to add all attributes (if true) or specific attributes ("attr" => true) instead of replacing them. By default, attributes are replaced.
Name | Type | Description |
---|---|---|
$collectionName | string | |
$documentId | mixed|\Zend_Cloud_DocumentService_Document | Document ID, adapter-dependent |
$fieldset | array|\Zend_Cloud_DocumentService_Document | Set of fields to update |
$options | array |
Type | Description |
---|---|
boolean |