Cloud/DocumentService/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 [email protected] so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Cloud  
Subpackage
DocumentService  

\Zend_Cloud_DocumentService_Query

Package: Zend_Cloud\DocumentService
Generic query object
Aggregates operations in an array of clauses, where the first element describes the clause type, and the next element describes the criteria.
Implements
Children
\Zend_Cloud_DocumentService_Adapter_SimpleDb_Query
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  QUERY_SELECT = 'select'
Known query types
>VConstant  QUERY_FROM = 'from'
>VConstant  QUERY_WHERE = 'where'
>VConstant  QUERY_WHEREID = 'whereid'
>VConstant  QUERY_LIMIT = 'limit'
>VConstant  QUERY_ORDER = 'order'

Properties

>VPropertyprotectedarray $_clauses = array()
Clause list
Default valuearray()Details
Type
array

Methods

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

Generic clause

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
methodpublicassemble() : array

"Assemble" the query

Simply returns the clauses present.
Returns
TypeDescription
array
methodpublicfrom(string $name) : \Zend_Cloud_DocumentService_Query

FROM clause

Parameters
NameTypeDescription
$namestring

Field names

Returns
TypeDescription
\Zend_Cloud_DocumentService_Query
methodpublicgetClauses() : array

Return query clauses as an array

Returns
TypeDescription
arrayClauses in the query
methodpubliclimit(int $limit) : \Zend_Cloud_DocumentService_Query

LIMIT clause (how many items to return)

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

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

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

SELECT clause (fields to be selected)

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

WHERE query

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

Select record or fields by ID

Parameters
NameTypeDescription
$valuestring | int

Identifier to select by

Returns
TypeDescription
\Zend_Cloud_DocumentService_Query
Documentation was generated by phpDocumentor 2.2.0 .