Cloud/DocumentService/Adapter/SimpleDb/Query.php

Show: PublicProtectedPrivateinherited
Table of Contents
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Cloud  
Subpackage
DocumentService  

\Zend_Cloud_DocumentService_Adapter_SimpleDb_Query

Package: Zend\Cloud\DocumentService
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

>VConstant  QUERY_SELECT = 'select'
inherited
Known query types
Inherited from: \Zend_Cloud_DocumentService_Query::QUERY_SELECT
>VConstant  QUERY_FROM = 'from'
>VConstant  QUERY_WHERE = 'where'
>VConstant  QUERY_WHEREID = 'whereid'
>VConstant  QUERY_LIMIT = 'limit'
>VConstant  QUERY_ORDER = 'order'

Properties

>VPropertyprotected\Zend_Cloud_DocumentService_Adapter_SimpleDb $_adapter
>VPropertyprotectedarray $_clauses = array()
inherited
Clause list
Inherited from: \Zend_Cloud_DocumentService_Query::$$_clauses
Default valuearray()Details
Type
array
Inherited_from
\Zend_Cloud_DocumentService_Query::$$_clauses  

Methods

methodpublic__call(string $name, mixed $args) : \Zend_Cloud_DocumentService_Query
inherited

Generic clause

Inherited from: \Zend_Cloud_DocumentService_Query::__call()

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'

Parameters
NameTypeDescription
$namestring

Clause/method name

$argsmixed
Returns
TypeDescription
\Zend_Cloud_DocumentService_Query
methodpublic__construct(\Zend_Cloud_DocumentService_Adapter_SimpleDb $adapter, null | string $collectionName = null) : void

Constructor

Parameters
NameTypeDescription
$adapter\Zend_Cloud_DocumentService_Adapter_SimpleDb
$collectionNamenull | string
methodprotected_parseWhere(string $where, array $args) : string

Parse a where statement into service-specific language

Parameters
NameTypeDescription
$wherestring
$argsarray
Returns
TypeDescription
string
Details
Todo
Ensure this fulfills the entire SimpleDB query specification for WHERE  
methodpublicassemble( $collectionName = null) : string

Assemble the query into a format the adapter can utilize

Simply returns the clauses present.

Parameters
NameTypeDescription
$collectionName
Returns
TypeDescription
string
Details
string

Name of collection from which to select

methodpublicfrom(string $name) : \Zend_Cloud_DocumentService_Query
inherited

FROM clause

Inherited from: \Zend_Cloud_DocumentService_Query::from()
Parameters
NameTypeDescription
$namestring

Field names

Returns
TypeDescription
\Zend_Cloud_DocumentService_Query
methodpublicgetClauses() : array
inherited

Return query clauses as an array

Inherited from: \Zend_Cloud_DocumentService_Query::getClauses()
Returns
TypeDescription
arrayClauses in the query
methodpubliclimit(int $limit) : \Zend_Cloud_DocumentService_Query
inherited

LIMIT clause (how many items to return)

Inherited from: \Zend_Cloud_DocumentService_Query::limit()
Parameters
NameTypeDescription
$limitint
Returns
TypeDescription
\Zend_Cloud_DocumentService_Query
methodpublicorder(string | int | array $sort, string $direction = 'asc') : \Zend_Cloud_DocumentService_Query
inherited

ORDER clause; field or fields to sort by, and direction to sort

Inherited from: \Zend_Cloud_DocumentService_Query::order()
Parameters
NameTypeDescription
$sortstring | int | array
$directionstring
Returns
TypeDescription
\Zend_Cloud_DocumentService_Query
methodpublicselect(null | string | array $select) : \Zend_Cloud_DocumentService_Query
inherited

SELECT clause (fields to be selected)

Inherited from: \Zend_Cloud_DocumentService_Query::select()
Parameters
NameTypeDescription
$selectnull | string | array
Returns
TypeDescription
\Zend_Cloud_DocumentService_Query
methodpublicwhere(string $cond,  $value = null, string $op = 'and') : \Zend_Cloud_DocumentService_Query
inherited

WHERE query

Inherited from: \Zend_Cloud_DocumentService_Query::where()
Parameters
NameTypeDescription
$condstring

Condition

$value
$opstring

relation to other clauses - and/or

Returns
TypeDescription
\Zend_Cloud_DocumentService_Query
methodpublicwhereId(string | int $value) : \Zend_Cloud_DocumentService_Query
inherited

Select record or fields by ID

Inherited from: \Zend_Cloud_DocumentService_Query::whereId()

This one should be used when fetching specific rows since some adapters have special syntax for primary keys

Parameters
NameTypeDescription
$valuestring | int

Identifier to select by

Returns
TypeDescription
\Zend_Cloud_DocumentService_Query
Documentation was generated by phpDocumentor 2.0.0a12.