Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Zend_Cloud_DocumentService_Query Class Reference

Public Member Functions

 __call ($name, $args)
 Generic clause.
 
 select ($select)
 SELECT clause (fields to be selected)
 
 from ($name)
 FROM clause.
 
 where ($cond, $value=null, $op= 'and')
 WHERE query.
 
 whereId ($value)
 Select record or fields by ID.
 
 limit ($limit)
 LIMIT clause (how many items to return)
 
 order ($sort, $direction= 'asc')
 ORDER clause; field or fields to sort by, and direction to sort.
 
 assemble ()
 "Assemble" the query
 
 getClauses ()
 Return query clauses as an array.
 

Public Attributes

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

Protected Attributes

 $_clauses = array()
 

Member Function Documentation

__call (   $name,
  $args 
)

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
string$nameClause/method name
mixed$args
Returns
Zend_Cloud_DocumentService_Query
assemble ( )

"Assemble" the query

Simply returns the clauses present.

Returns
array

Implements Zend_Cloud_DocumentService_QueryAdapter.

from (   $name)

FROM clause.

Parameters
string$nameField names
Returns
Zend_Cloud_DocumentService_Query

Implements Zend_Cloud_DocumentService_QueryAdapter.

getClauses ( )

Return query clauses as an array.

Returns
array Clauses in the query
limit (   $limit)

LIMIT clause (how many items to return)

Parameters
int$limit
Returns
Zend_Cloud_DocumentService_Query

Implements Zend_Cloud_DocumentService_QueryAdapter.

order (   $sort,
  $direction = 'asc' 
)

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

Parameters
string | int | array$sort
string$direction
Returns
Zend_Cloud_DocumentService_Query

Implements Zend_Cloud_DocumentService_QueryAdapter.

select (   $select)

SELECT clause (fields to be selected)

Parameters
null | string | array$select
Returns
Zend_Cloud_DocumentService_Query

Implements Zend_Cloud_DocumentService_QueryAdapter.

where (   $cond,
  $value = null,
  $op = 'and' 
)

WHERE query.

Parameters
string$condCondition
array$argsArguments to substitute instead of ?'s in condition
string$oprelation to other clauses - and/or
Returns
Zend_Cloud_DocumentService_Query

Implements Zend_Cloud_DocumentService_QueryAdapter.

whereId (   $value)

Select record or fields by ID.

Parameters
string | int$valueIdentifier to select by
Returns
Zend_Cloud_DocumentService_Query

Implements Zend_Cloud_DocumentService_QueryAdapter.

Member Data Documentation

$_clauses = array()
protected
const QUERY_FROM = 'from'
const QUERY_LIMIT = 'limit'
const QUERY_ORDER = 'order'
const QUERY_SELECT = 'select'

Known query types.

const QUERY_WHERE = 'where'
const QUERY_WHEREID = 'whereid'