Public Member Functions | Protected Attributes

QueryWhere Class Reference

List of all members.

Public Member Functions

 __construct ($operator= 'AND')
 create ($operator= 'AND')
 add ($expression, $parameters=array(), $name=null)
 get_named ($name)
 in ($field, $values, $paramname=null, $validator=null, $positive=true)
 exists (Query $values, $paramname=null, $positive=true)
 params ()
 __set ($name, $value)
 __get ($name)
 get ($level=0)
 count ()

Protected Attributes

 $operator= 'AND'
 $expressions = array()
 $parameters = array()

Detailed Description

QueryWhere Represents a where clause (or subclause) of a Query

See also:
Query

Definition at line 337 of file query.php.


Constructor & Destructor Documentation

QueryWhere::__construct ( operator = 'AND'  ) 

Constructor for the QueryWhere

Parameters:
string $operator The operator (AND/OR) to user between expressions in this clause

Definition at line 346 of file query.php.


Member Function Documentation

QueryWhere::__get ( name  ) 

Get a parameter value, class magic __get method

Parameters:
string $name The name of the parameter to get
Returns:
mixed The value of the parameter requested

Definition at line 526 of file query.php.

QueryWhere::__set ( name,
value 
)

Set a parameter value, class magic __set method

Parameters:
string $name The name of the parameter to set
mixed $value The value to set the parameter to
Returns:
mixed The supplied value

Definition at line 515 of file query.php.

QueryWhere::add ( expression,
parameters = array(),
name = null 
)
Parameters:
string|QueryWhere $expression A string expression to use as part of the query's where clause or a compound expression represented by an additional QueryWhere instance
array $parameters An associative array of values to use as named parameters in the added expression
string $name Name of the expression
Returns:
QueryWhere Returns $this, for fluid interface.

Definition at line 368 of file query.php.

QueryWhere::count (  ) 

Get the number of expressions contained in this QueryWhere

Returns:
int Number of expressions.

Definition at line 566 of file query.php.

Referenced by add(), exists(), get(), and in().

QueryWhere::create ( operator = 'AND'  ) 

Convenience function for fluid interface

Parameters:
string $operator The operator (AND/OR) to user between expressions in this clause
Returns:
QueryWhere Configured instance of the QueryWhere

Definition at line 356 of file query.php.

QueryWhere::exists ( Query values,
paramname = null,
positive = true 
)

Shortcut to implementing an EXISTS test for one or more values as a new expression

Parameters:
Query $values
string $paramname
boolean $positive
Returns:
QueryWhere Returns $this, for fluid interface

Definition at line 471 of file query.php.

QueryWhere::get ( level = 0  ) 

Obtain the where clause as a string to use in a query

Parameters:
int $level Used internally to retain indenting
Returns:
string The where clause represented by this object

Definition at line 536 of file query.php.

QueryWhere::get_named ( name  ) 

Return the named expression from this QueryWhere

Parameters:
string $name The name provided for the expression
Returns:
null|string|QueryWhere The requested expression

Definition at line 383 of file query.php.

QueryWhere::in ( field,
values,
paramname = null,
validator = null,
positive = true 
)

Shortcut to implementing an IN or equality test for one or more values as a new expression

Parameters:
$field 
$values 
string $paramname
callback $validator
boolean $positive
Returns:
QueryWhere Returns $this, for fluid interface

Definition at line 400 of file query.php.

QueryWhere::params (  ) 

Obtain the parameters supplied for the where clause

Returns:
array An associative array of parameters added to this where clause

Definition at line 495 of file query.php.


The documentation for this class was generated from the following file: