Elgg  Version 6.1
QueryOptions.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Database;
4 
16 
68 class QueryOptions extends \ArrayObject {
69 
71 
75  public function __construct($input = [], $flags = 0, $iterator_class = 'ArrayIterator') {
76  $input = $this->normalizeOptions($input);
77  parent::__construct($input, $flags, $iterator_class);
78  }
79 
83  public function __get($name) {
84  $val = &$this[$name];
85 
86  return $val;
87  }
88 
92  public function __set($name, $value) {
93  $this[$name] = $value;
94  }
95 
99  public function __unset($name) {
100  unset($this[$name]);
101  }
102 
106  public function __isset($name) {
107  return isset($this[$name]);
108  }
109 
117  public function distinct($distinct = true) {
118  $this->distinct = $distinct;
119 
120  return $this;
121  }
122 
130  public function where(WhereClause $clause) {
131  $this->wheres[] = $clause;
132 
133  return $this;
134  }
135 
143  public function select(SelectClause $clause) {
144  $this->selects[] = $clause;
145 
146  return $this;
147  }
148 
156  public function join(JoinClause $clause) {
157  $this->joins[] = $clause;
158 
159  return $this;
160  }
161 
169  public function groupBy(GroupByClause $clause) {
170  $this->group_by[] = $clause;
171 
172  return $this;
173  }
174 
182  public function having(HavingClause $clause) {
183  $this->having[] = $clause;
184 
185  return $this;
186  }
187 
195  public function orderBy(OrderByClause $clause) {
196  $this->order_by[] = $clause;
197 
198  return $this;
199  }
200 }
groupBy(GroupByClause $clause)
Add group by statement.
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
__construct($input=[], $flags=0, $iterator_class= 'ArrayIterator')
{}
where(WhereClause $clause)
Add where statement.
orderBy(OrderByClause $clause)
Add order by statement.
Extends QueryBuilder with JOIN clauses.
Definition: JoinClause.php:11
Extends QueryBuilder with SELECT clauses.
join(JoinClause $clause)
Add a join callback.
Extends QueryBuilder with GROUP BY statements.
having(HavingClause $clause)
Add having statement.
$value
Definition: generic.php:51
__set($name, $value)
{}
Extends QueryBuilder with HAVING clauses.
select(SelectClause $clause)
Add a select statement.
distinct($distinct=true)
Return DISTINCT rows.
Extends QueryBuilder with ORDER BY clauses.
Builds a clause from closure or composite expression.
Definition: WhereClause.php:11
$input
Form field view.
Definition: field.php:13