Framework  3.9
AbstractQuery Class Reference
+ Inheritance diagram for AbstractQuery:

Public Member Functions

 __construct ($class, $constraints="")
 
 constraints ($constraints)
 Sets the constraint clause for the Query. More...
 
 filter ($filter)
 Sets a filter to constrain the fields retrieved when the query is executed. More...
 
 params ($params)
 Sets the bound parameters array. More...
 
 bind ()
 Binds placeholders to parameter values. More...
 
 execute ()
 

Public Attributes

 $class
 
 $constraints
 
 $filter
 
 $params
 

Detailed Description

Definition at line 37 of file query.inc.

Constructor & Destructor Documentation

◆ __construct()

AbstractQuery::__construct (   $class,
  $constraints = "" 
)

Reimplemented in Query, JSONQuery, IteratedQuery, PivotQuery, and AbstractPivotQuery.

Definition at line 44 of file query.inc.

45  {
46  $this->class = $class;
47  $this->constraints = $this->massageSQL($constraints);
48 
49  $this->filter = null;
50  $this->params = array();
51  }
constraints($constraints)
Sets the constraint clause for the Query.
Definition: query.inc:68
filter($filter)
Sets a filter to constrain the fields retrieved when the query is executed.
Definition: query.inc:79
params($params)
Sets the bound parameters array.
Definition: query.inc:91

Member Function Documentation

◆ bind()

AbstractQuery::bind ( )

Binds placeholders to parameter values.

Returns
Query reference to the Query object, to allow for call chaining.

Definition at line 101 of file query.inc.

102  {
103  $num = func_num_args();
104  for($i = 0; $i < $num; $i += 2)
105  {
106  $this->params[func_get_arg($i)] = $this->massageSQL(func_get_arg($i + 1));
107  }
108 
109  return $this;
110  }

◆ constraints()

AbstractQuery::constraints (   $constraints)

Sets the constraint clause for the Query.

Parameters
string$constraintsthe constraint clause;
Returns
Query reference to the Query object, to allow for call chaining.

Definition at line 68 of file query.inc.

69  {
70  $this->constraints = $this->massageSQL($constraints);
71  return $this;
72  }

◆ execute()

AbstractQuery::execute ( )
abstract

◆ filter()

AbstractQuery::filter (   $filter)

Sets a filter to constrain the fields retrieved when the query is executed.

Parameters
$filterObject the InclusionFilter or ExclusionFilter to use
Returns
Query reference to the Query object, to allow for call chaining.

Definition at line 79 of file query.inc.

80  {
81  $this->filter = $filter;
82  return $this;
83  }

◆ params()

AbstractQuery::params (   $params)

Sets the bound parameters array.

Generally it is more convenient to call bind() but this method can be useful if the query is being constructed programmatically.

Parameters
$paramsthe array of placeholders and parameters to bind
Returns
Query reference to the Query object, to allow for call chaining.

Definition at line 91 of file query.inc.

92  {
93  $this->params = $params;
94  return $this;
95  }

Member Data Documentation

◆ $class

AbstractQuery::$class

Definition at line 39 of file query.inc.

◆ $constraints

AbstractQuery::$constraints

Definition at line 40 of file query.inc.

◆ $filter

AbstractQuery::$filter

Definition at line 41 of file query.inc.

◆ $params

AbstractQuery::$params

Definition at line 42 of file query.inc.


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