web/lib/Zend/Cloud/DocumentService/Adapter.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    11  * to license@zend.com so we can send you a copy immediately.
    11  * to license@zend.com so we can send you a copy immediately.
    12  *
    12  *
    13  * @category   Zend
    13  * @category   Zend
    14  * @package    Zend_Cloud
    14  * @package    Zend_Cloud
    15  * @subpackage DocumentService
    15  * @subpackage DocumentService
    16  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    16  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    17  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    17  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    18  */
    18  */
    19 
    19 
    20 /**
    20 /**
    21  * Common interface for document storage services in the cloud. This interface
    21  * Common interface for document storage services in the cloud. This interface
    29  * access control support in future versions of the interface.
    29  * access control support in future versions of the interface.
    30  *
    30  *
    31  * @category   Zend
    31  * @category   Zend
    32  * @package    Zend_Cloud
    32  * @package    Zend_Cloud
    33  * @subpackage DocumentService
    33  * @subpackage DocumentService
    34  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    34  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    35  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    35  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    36  */
    36  */
    37 interface Zend_Cloud_DocumentService_Adapter
    37 interface Zend_Cloud_DocumentService_Adapter
    38 {
    38 {
    39     // HTTP adapter to use for connections
    39     // HTTP adapter to use for connections
    65      */
    65      */
    66     public function listCollections($options = null);
    66     public function listCollections($options = null);
    67 
    67 
    68     /**
    68     /**
    69      * List all documents in a collection
    69      * List all documents in a collection
    70      * 
    70      *
    71      * @param  string $collectionName 
    71      * @param  string $collectionName
    72      * @param  null|array $options 
    72      * @param  null|array $options
    73      * @return Zend_Cloud_DocumentService_DocumentSet
    73      * @return Zend_Cloud_DocumentService_DocumentSet
    74      */
    74      */
    75     public function listDocuments($collectionName, array $options = null);
    75     public function listDocuments($collectionName, array $options = null);
    76 
    76 
    77     /**
    77     /**
    85     public function insertDocument($collectionName, $document, $options = null);
    85     public function insertDocument($collectionName, $document, $options = null);
    86 
    86 
    87     /**
    87     /**
    88      * Replace document
    88      * Replace document
    89      * The new document replaces the existing document with the same ID.
    89      * The new document replaces the existing document with the same ID.
    90      * 
    90      *
    91      * @param string $collectionName Collection name
    91      * @param string $collectionName Collection name
    92      * @param Zend_Cloud_DocumentService_Document $document
    92      * @param Zend_Cloud_DocumentService_Document $document
    93      * @param array $options
    93      * @param array $options
    94      */
    94      */
    95     public function replaceDocument($collectionName, $document, $options = null);
    95     public function replaceDocument($collectionName, $document, $options = null);
    96 
    96 
    97     /**
    97     /**
    98      * Update document
    98      * Update document
    99      * The fields of the existing documents will be updated. 
    99      * The fields of the existing documents will be updated.
   100      * Fields not specified in the set will be left as-is. 
   100      * Fields not specified in the set will be left as-is.
   101      *
   101      *
   102      * @param  string $collectionName
   102      * @param  string $collectionName
   103      * @param  mixed|Zend_Cloud_DocumentService_Document $documentID Document ID, adapter-dependent, or document containing updates
   103      * @param  mixed|Zend_Cloud_DocumentService_Document $documentID Document ID, adapter-dependent, or document containing updates
   104      * @param  array|Zend_Cloud_DocumentService_Document $fieldset Set of fields to update
   104      * @param  array|Zend_Cloud_DocumentService_Document $fieldset Set of fields to update
   105      * @param  array                   $options
   105      * @param  array                   $options
   106      * @return boolean
   106      * @return boolean
   107      */
   107      */
   108     public function updateDocument($collectionName, $documentID, $fieldset = null, $options = null);
   108     public function updateDocument($collectionName, $documentID, $fieldset = null, $options = null);
   109     
   109 
   110     /**
   110     /**
   111      * Delete document
   111      * Delete document
   112      *
   112      *
   113      * @param string $collectionName Collection name
   113      * @param string $collectionName Collection name
   114      * @param mixed  $documentID Document ID, adapter-dependent
   114      * @param mixed  $documentID Document ID, adapter-dependent
   117      */
   117      */
   118     public function deleteDocument($collectionName, $documentID, $options = null);
   118     public function deleteDocument($collectionName, $documentID, $options = null);
   119 
   119 
   120     /**
   120     /**
   121      * Fetch single document by ID
   121      * Fetch single document by ID
   122      * 
   122      *
   123      * Will return false if the document does not exist
   123      * Will return false if the document does not exist
   124      * 
   124      *
   125      * @param string $collectionName Collection name
   125      * @param string $collectionName Collection name
   126      * @param mixed $documentID Document ID, adapter-dependent
   126      * @param mixed $documentID Document ID, adapter-dependent
   127      * @param array $options
   127      * @param array $options
   128      * @return Zend_Cloud_DocumentService_Document
   128      * @return Zend_Cloud_DocumentService_Document
   129      */
   129      */
   130     public function fetchDocument($collectionName, $documentID, $options = null);
   130     public function fetchDocument($collectionName, $documentID, $options = null);
   131     
   131 
   132     /**
   132     /**
   133      * Query for documents stored in the document service. If a string is passed in
   133      * Query for documents stored in the document service. If a string is passed in
   134      * $query, the query string will be passed directly to the service.
   134      * $query, the query string will be passed directly to the service.
   135      *
   135      *
   136      * @param  string $collectionName Collection name
   136      * @param  string $collectionName Collection name
   137      * @param  string $query
   137      * @param  string $query
   138      * @param  array $options
   138      * @param  array $options
   139      * @return array Array of field sets
   139      * @return array Array of field sets
   140      */
   140      */
   141     public function query($collectionName, $query, $options = null);
   141     public function query($collectionName, $query, $options = null);
   142     
   142 
   143     /**
   143     /**
   144      * Create query statement
   144      * Create query statement
   145      * 
   145      *
   146      * @param string $fields
   146      * @param string $fields
   147      * @return Zend_Cloud_DocumentService_Query
   147      * @return Zend_Cloud_DocumentService_Query
   148      */
   148      */
   149     public function select($fields = null);
   149     public function select($fields = null);
   150     
   150 
   151     /**
   151     /**
   152      * Get the concrete service client
   152      * Get the concrete service client
   153      */
   153      */
   154     public function getClient();
   154     public function getClient();
   155 }
   155 }