Elgg  Version 3.0
QueryOptions.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Database;
4 
5 use ArrayObject;
17 
72 class QueryOptions extends ArrayObject implements QueryFiltering {
73 
75 
79  public function __construct($input = [], $flags = 0, $iterator_class = "ArrayIterator") {
80  $input = $this->normalizeOptions($input);
81  parent::__construct($input, $flags, $iterator_class);
82  }
83 
87  public function __get($name) {
88  $val = &$this[$name];
89 
90  return $val;
91  }
92 
96  public function __set($name, $value) {
97  $this[$name] = $value;
98  }
99 
103  public function __unset($name) {
104  unset($this[$name]);
105  }
106 
110  public function __isset($name) {
111  return isset($this[$name]);
112  }
113 
117  public function distinct($distinct = true) {
118  $this->distinct = $distinct;
119 
120  return $this;
121  }
122 
126  public function where(WhereClause $clause) {
127  $this->wheres[] = $clause;
128 
129  return $this;
130  }
131 
135  public function select(SelectClause $clause) {
136  $this->selects[] = $clause;
137 
138  return $this;
139  }
140 
144  public function join(JoinClause $clause) {
145  $this->joins[] = $clause;
146 
147  return $this;
148  }
149 
153  public function groupBy(GroupByClause $clause) {
154  $this->group_by[] = $clause;
155 
156  return $this;
157  }
158 
162  public function having(HavingClause $clause) {
163  $this->having[] = $clause;
164 
165  return $this;
166  }
167 
171  public function orderBy(OrderByClause $clause) {
172  $this->order_by[] = $clause;
173 
174  return $this;
175  }
176 
177 }
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
groupBy(GroupByClause $clause)
{Add group by statement.Clausestatic}
where(WhereClause $clause)
{Add where statement.Clausestatic}
This interface defines methods for filtering/extending database queries.
orderBy(OrderByClause $clause)
{Add order by statement.Clausestatic}
Extends QueryBuilder with JOIN clauses.
Definition: JoinClause.php:12
Extends QueryBuilder with SELECT clauses.
join(JoinClause $clause)
{Add a join callback.Clausestatic}
Extends QueryBuilder with GROUP BY statements.
__construct($input=[], $flags=0, $iterator_class="ArrayIterator")
{}
having(HavingClause $clause)
{Add having statement.Clausestatic}
__set($name, $value)
{}
Extends QueryBuilder with HAVING clauses.
select(SelectClause $clause)
{Add a select statement.Clause$this}
distinct($distinct=true)
{Return DISTINCT rows.Distinctstatic}
Extends QueryBuilder with ORDER BY clauses.
$value
Definition: debugging.php:7
Builds a clause from closure or composite expression.
Definition: WhereClause.php:12
$input
Form field view.
Definition: field.php:13