Fakoli Framework
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 34 of file query.inc.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 41 of file query.inc.

42  {
43  $this->class = $class;
44  $this->constraints = $constraints;
45 
46  $this->filter = null;
47  $this->params = array();
48  }
params($params)
Sets the bound parameters array.
Definition: query.inc:78
constraints($constraints)
Sets the constraint clause for the Query.
Definition: query.inc:55
filter($filter)
Sets a filter to constrain the fields retrieved when the query is executed.
Definition: query.inc:66

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 88 of file query.inc.

89  {
90  $num = func_num_args();
91  for($i = 0; $i < $num; $i += 2)
92  {
93  $this->params[func_get_arg($i)] = func_get_arg($i + 1);
94  }
95 
96  return $this;
97  }
params($params)
Sets the bound parameters array.
Definition: query.inc:78

◆ constraints()

AbstractQuery::constraints (   $constraints)

Sets the constraint clause for the Query.

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

Definition at line 55 of file query.inc.

56  {
57  $this->constraints = $constraints;
58  return $this;
59  }
constraints($constraints)
Sets the constraint clause for the Query.
Definition: query.inc:55

◆ 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 66 of file query.inc.

67  {
68  $this->filter = $filter;
69  return $this;
70  }
filter($filter)
Sets a filter to constrain the fields retrieved when the query is executed.
Definition: query.inc:66

◆ 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 78 of file query.inc.

79  {
80  $this->params = $params;
81  return $this;
82  }
params($params)
Sets the bound parameters array.
Definition: query.inc:78

Member Data Documentation

◆ $class

AbstractQuery::$class

Definition at line 36 of file query.inc.

◆ $constraints

AbstractQuery::$constraints

Definition at line 37 of file query.inc.

◆ $filter

AbstractQuery::$filter

Definition at line 38 of file query.inc.

◆ $params

AbstractQuery::$params

Definition at line 39 of file query.inc.


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