Cloud/DocumentService/Adapter/SimpleDb/Query.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 [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Cloud
- Subpackage
- DocumentService
\Zend_Cloud_DocumentService_Adapter_SimpleDb_Query
Class implementing Query adapter for working with SimpleDb queries in a structured way
Aggregates operations in an array of clauses, where the first element describes the clause type, and the next element describes the criteria.
- Parent(s)
- \Zend_Cloud_DocumentService_Query
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
QUERY_FROM
= 'from'- Inherited_from
- \Zend_Cloud_DocumentService_Query::QUERY_FROM
QUERY_WHERE
= 'where'- Inherited_from
- \Zend_Cloud_DocumentService_Query::QUERY_WHERE
QUERY_WHEREID
= 'whereid'- Inherited_from
- \Zend_Cloud_DocumentService_Query::QUERY_WHEREID
QUERY_LIMIT
= 'limit'- Inherited_from
- \Zend_Cloud_DocumentService_Query::QUERY_LIMIT
QUERY_ORDER
= 'order'- Inherited_from
- \Zend_Cloud_DocumentService_Query::QUERY_ORDER
Properties

array $_clauses = array()
array()Details- Type
- array
- Inherited_from
- \Zend_Cloud_DocumentService_Query::$$_clauses
Methods

__call(string $name, mixed $args) : \Zend_Cloud_DocumentService_Query
You can use any clause by doing $query->foo('bar') but concrete adapters should be able to recognise it
The call will be iterpreted as clause 'foo' with argument 'bar'
| Name | Type | Description |
|---|---|---|
| $name | string | Clause/method name |
| $args | mixed |
| Type | Description |
|---|---|
| \Zend_Cloud_DocumentService_Query |

__construct(\Zend_Cloud_DocumentService_Adapter_SimpleDb $adapter, null | string $collectionName = null) : voidConstructor
| Name | Type | Description |
|---|---|---|
| $adapter | \Zend_Cloud_DocumentService_Adapter_SimpleDb | |
| $collectionName | null | string |

_parseWhere(string $where, array $args) : stringParse a where statement into service-specific language
| Name | Type | Description |
|---|---|---|
| $where | string | |
| $args | array |
| Type | Description |
|---|---|
| string |
- Todo
- Ensure this fulfills the entire SimpleDB query specification for WHERE

assemble( $collectionName = null) : stringAssemble the query into a format the adapter can utilize
Simply returns the clauses present.
| Name | Type | Description |
|---|---|---|
| $collectionName |
| Type | Description |
|---|---|
| string |
- string
Name of collection from which to select

from(string $name) : \Zend_Cloud_DocumentService_Query
| Name | Type | Description |
|---|---|---|
| $name | string | Field names |
| Type | Description |
|---|---|
| \Zend_Cloud_DocumentService_Query |

getAdapter() : \Zend_Cloud_DocumentService_Adapter_SimpleDbGet adapter
| Type | Description |
|---|---|
| \Zend_Cloud_DocumentService_Adapter_SimpleDb |

getClauses() : arrayReturn query clauses as an array
Inherited from: \Zend_Cloud_DocumentService_Query::getClauses()| Type | Description |
|---|---|
| array | Clauses in the query |

limit(int $limit) : \Zend_Cloud_DocumentService_QueryLIMIT clause (how many items to return)
Inherited from: \Zend_Cloud_DocumentService_Query::limit()| Name | Type | Description |
|---|---|---|
| $limit | int |
| Type | Description |
|---|---|
| \Zend_Cloud_DocumentService_Query |

order(string | int | array $sort, string $direction = 'asc') : \Zend_Cloud_DocumentService_QueryORDER clause; field or fields to sort by, and direction to sort
Inherited from: \Zend_Cloud_DocumentService_Query::order()| Name | Type | Description |
|---|---|---|
| $sort | string | int | array | |
| $direction | string |
| Type | Description |
|---|---|
| \Zend_Cloud_DocumentService_Query |

select(null | string | array $select) : \Zend_Cloud_DocumentService_QuerySELECT clause (fields to be selected)
Inherited from: \Zend_Cloud_DocumentService_Query::select()| Name | Type | Description |
|---|---|---|
| $select | null | string | array |
| Type | Description |
|---|---|
| \Zend_Cloud_DocumentService_Query |

where(string $cond, $value = null, string $op = 'and') : \Zend_Cloud_DocumentService_Query
| Name | Type | Description |
|---|---|---|
| $cond | string | Condition |
| $value | ||
| $op | string | relation to other clauses - and/or |
| Type | Description |
|---|---|
| \Zend_Cloud_DocumentService_Query |

whereId(string | int $value) : \Zend_Cloud_DocumentService_Query
This one should be used when fetching specific rows since some adapters have special syntax for primary keys
| Name | Type | Description |
|---|---|---|
| $value | string | int | Identifier to select by |
| Type | Description |
|---|---|
| \Zend_Cloud_DocumentService_Query |