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 * This interface describes the API that concrete query adapter should implement |
21 * This interface describes the API that concrete query adapter should implement |
22 * |
22 * |
23 * Common interface for document storage services in the cloud. This interface |
23 * Common interface for document storage services in the cloud. This interface |
24 * supports most document services and provides some flexibility for |
24 * supports most document services and provides some flexibility for |
25 * vendor-specific features and requirements via an optional $options array in |
25 * vendor-specific features and requirements via an optional $options array in |
26 * each method signature. Classes implementing this interface should implement |
26 * each method signature. Classes implementing this interface should implement |
27 * URI construction for collections and documents from the parameters given in each |
27 * URI construction for collections and documents from the parameters given in each |
32 * optimization mechanisms are also not supported in this version. |
32 * optimization mechanisms are also not supported in this version. |
33 * |
33 * |
34 * @category Zend |
34 * @category Zend |
35 * @package Zend_Cloud |
35 * @package Zend_Cloud |
36 * @subpackage DocumentService |
36 * @subpackage DocumentService |
37 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
37 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
38 * @license http://framework.zend.com/license/new-bsd New BSD License |
38 * @license http://framework.zend.com/license/new-bsd New BSD License |
39 */ |
39 */ |
40 interface Zend_Cloud_DocumentService_QueryAdapter |
40 interface Zend_Cloud_DocumentService_QueryAdapter |
41 { |
41 { |
42 /** |
42 /** |
43 * SELECT clause (fields to be selected) |
43 * SELECT clause (fields to be selected) |
44 * |
44 * |
45 * @param string $select |
45 * @param string $select |
46 * @return Zend_Cloud_DocumentService_QueryAdapter |
46 * @return Zend_Cloud_DocumentService_QueryAdapter |
47 */ |
47 */ |
48 public function select($select); |
48 public function select($select); |
49 |
49 |
50 /** |
50 /** |
51 * FROM clause (table name) |
51 * FROM clause (table name) |
52 * |
52 * |
53 * @param string $from |
53 * @param string $from |
54 * @return Zend_Cloud_DocumentService_QueryAdapter |
54 * @return Zend_Cloud_DocumentService_QueryAdapter |
55 */ |
55 */ |
56 public function from($from); |
56 public function from($from); |
57 |
57 |
58 /** |
58 /** |
59 * WHERE clause (conditions to be used) |
59 * WHERE clause (conditions to be used) |
60 * |
60 * |
61 * @param string $where |
61 * @param string $where |
62 * @param mixed $value Value or array of values to be inserted instead of ? |
62 * @param mixed $value Value or array of values to be inserted instead of ? |
63 * @param string $op Operation to use to join where clauses (AND/OR) |
63 * @param string $op Operation to use to join where clauses (AND/OR) |
64 * @return Zend_Cloud_DocumentService_QueryAdapter |
64 * @return Zend_Cloud_DocumentService_QueryAdapter |
65 */ |
65 */ |
66 public function where($where, $value = null, $op = 'and'); |
66 public function where($where, $value = null, $op = 'and'); |
67 |
67 |
68 /** |
68 /** |
69 * WHERE clause for item ID |
69 * WHERE clause for item ID |
70 * |
70 * |
71 * This one should be used when fetching specific rows since some adapters |
71 * This one should be used when fetching specific rows since some adapters |
72 * have special syntax for primary keys |
72 * have special syntax for primary keys |
73 * |
73 * |
74 * @param mixed $value Row ID for the document |
74 * @param mixed $value Row ID for the document |
75 * @return Zend_Cloud_DocumentService_QueryAdapter |
75 * @return Zend_Cloud_DocumentService_QueryAdapter |
76 */ |
76 */ |
77 public function whereId($value); |
77 public function whereId($value); |
78 |
78 |
79 /** |
79 /** |
80 * LIMIT clause (how many rows ot return) |
80 * LIMIT clause (how many rows ot return) |
81 * |
81 * |
82 * @param int $limit |
82 * @param int $limit |
83 * @return Zend_Cloud_DocumentService_QueryAdapter |
83 * @return Zend_Cloud_DocumentService_QueryAdapter |
84 */ |
84 */ |
85 public function limit($limit); |
85 public function limit($limit); |
86 |
86 |
87 /** |
87 /** |
88 * ORDER BY clause (sorting) |
88 * ORDER BY clause (sorting) |
89 * |
89 * |
90 * @param string $sort Column to sort by |
90 * @param string $sort Column to sort by |
91 * @param string $direction Direction - asc/desc |
91 * @param string $direction Direction - asc/desc |
92 * @return Zend_Cloud_DocumentService_QueryAdapter |
92 * @return Zend_Cloud_DocumentService_QueryAdapter |
93 */ |
93 */ |
94 public function order($sort, $direction = 'asc'); |
94 public function order($sort, $direction = 'asc'); |
95 |
95 |
96 /** |
96 /** |
97 * Assemble the query into a format the adapter can utilize |
97 * Assemble the query into a format the adapter can utilize |
98 * |
98 * |
99 * @return mixed |
99 * @return mixed |
100 */ |
100 */ |
101 public function assemble(); |
101 public function assemble(); |
102 } |
102 } |