Elgg  Version 3.0
PrivateSettingWhereClause.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Database\Clauses;
4 
6 
11 
15  public $ids;
16 
20  public $entity_guids;
21 
25  public $names;
26 
30  public $comparison = '=';
31 
35  public $values;
36 
41 
46 
50  public function prepare(QueryBuilder $qb, $table_alias = null) {
51  $alias = function ($column) use ($table_alias) {
52  return $table_alias ? "{$table_alias}.{$column}" : $column;
53  };
54 
55  $wheres = [];
56  $wheres[] = parent::prepare($qb, $table_alias);
57 
58  $wheres[] = $qb->compare($alias('id'), '=', $this->ids, ELGG_VALUE_ID);
59  $wheres[] = $qb->compare($alias('name'), '=', $this->names, ELGG_VALUE_STRING);
60  $wheres[] = $qb->compare($alias('value'), $this->comparison, $this->values, $this->value_type, $this->case_sensitive);
61  $wheres[] = $qb->compare($alias('entity_guid'), '=', $this->entity_guids, ELGG_VALUE_GUID);
62 
63  return $qb->merge($wheres);
64  }
65 
66 }
$column
Definition: add.php:10
const ELGG_VALUE_GUID
Definition: constants.php:140
Database abstraction query builder.
const ELGG_VALUE_ID
Definition: constants.php:141
compare($x, $comparison, $y=null, $type=null, $case_sensitive=null)
Build value comparison clause.
Builds a clause from closure or composite expression.
Definition: WhereClause.php:12
merge($parts=null, $boolean= 'AND')
Merges multiple composite expressions with a boolean.
const ELGG_VALUE_STRING
Definition: constants.php:139
Builds queries for filtering entties by their properties in private_settings table.
prepare(QueryBuilder $qb, $table_alias=null)
{Build an expression and/or apply it to an instance of query builder.Query builder Table aliasComposi...