Elgg
Version master
engine
classes
Elgg
Database
Clauses
AttributeWhereClause.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Elgg\Database\Clauses
;
4
5
use
Elgg\Database\QueryBuilder
;
6
10
class
AttributeWhereClause
extends
WhereClause
{
11
15
public
$names
;
16
20
public
$comparison
=
'='
;
21
25
public
$values
;
26
30
public
$value_type
=
ELGG_VALUE_STRING
;
31
35
public
$case_sensitive
;
36
40
public
function
prepare
(
QueryBuilder
$qb
, $table_alias =
null
) {
41
$alias =
function
(
$column
) use ($table_alias) {
42
return
$table_alias ?
"{$table_alias}.{$column}"
:
$column
;
43
};
44
45
$wheres = [];
46
$wheres[] = parent::prepare(
$qb
, $table_alias);
47
48
foreach
((array) $this->names as
$name
) {
49
$wheres[] =
$qb
->compare($alias(
$name
), $this->comparison, $this->values, $this->value_type, $this->case_sensitive);
50
}
51
52
return
$qb
->merge($wheres);
53
}
54
}
$name
if(! $user||! $user->canDelete()) $name
Definition:
delete.php:22
$column
$column
Definition:
add.php:10
Elgg\Database\Clauses\AttributeWhereClause
Builds quereis for matching entities by their attributes.
Definition:
AttributeWhereClause.php:10
Elgg\Database\Clauses\AttributeWhereClause\$value_type
$value_type
Definition:
AttributeWhereClause.php:30
Elgg\Database\Clauses\AttributeWhereClause\$case_sensitive
$case_sensitive
Definition:
AttributeWhereClause.php:35
Elgg\Database\Clauses\AttributeWhereClause\$values
$values
Definition:
AttributeWhereClause.php:25
Elgg\Database\Clauses\AttributeWhereClause\$comparison
$comparison
Definition:
AttributeWhereClause.php:20
Elgg\Database\Clauses\AttributeWhereClause\$names
$names
Definition:
AttributeWhereClause.php:15
Elgg\Database\Clauses\AttributeWhereClause\prepare
prepare(QueryBuilder $qb, $table_alias=null)
{{Build an expression and/or apply it to an instance of query builder.Query builder Table aliasCompos...
Definition:
AttributeWhereClause.php:40
Elgg\Database\Clauses\WhereClause
Builds a clause from closure or composite expression.
Definition:
WhereClause.php:11
Elgg\Database\QueryBuilder
Database abstraction query builder.
Definition:
QueryBuilder.php:20
ELGG_VALUE_STRING
const ELGG_VALUE_STRING
Definition:
constants.php:112
Elgg\Database\Clauses
Definition:
AccessWhereClause.php:3
$qb
$qb
Definition:
queue.php:12
Generated on Fri Aug 29 2025 00:01:57 for Elgg by
1.9.1