34 $alias =
function (
$column) use ($table_alias) {
35 return $table_alias ?
"{$table_alias}.{$column}" :
$column;
38 if (!isset($this->viewer_guid)) {
39 $this->viewer_guid =
_elgg_services()->session_manager->getLoggedInUserGuid();
42 if (!isset($this->ignore_access)) {
43 $this->ignore_access =
_elgg_services()->userCapabilities->canBypassPermissionsCheck($this->viewer_guid);
46 if (!isset($this->use_enabled_clause)) {
47 $this->use_enabled_clause = !
_elgg_services()->session_manager->getDisabledEntityVisibility();
50 if (!isset($this->use_deleted_clause)) {
51 $this->use_deleted_clause = !
_elgg_services()->session_manager->getDeletedEntityVisibility();
57 $ands[] = parent::prepare($qb, $table_alias);
59 if (!$this->ignore_access) {
60 if ($this->viewer_guid) {
66 $access_list =
_elgg_services()->accessCollections->getAccessArray($this->viewer_guid);
70 if ($this->use_enabled_clause) {
74 if ($this->use_deleted_clause) {
79 'table_alias' => $table_alias,
89 'query_builder' =>
$qb,
97 $ors = array_filter($clauses[
'ors']);
98 $ands = array_filter($clauses[
'ands']);
101 $ands[] = $qb->
merge($ors,
'OR');
104 return $qb->
merge($ands);
$params
Saves global plugin settings.
const ELGG_VALUE_INTEGER
Value types.
Database abstraction query builder.
string $owner_guid_column
compare(string $x, string $comparison, $y=null, string $type=null, bool $case_sensitive=null)
Build value comparison clause.
prepare(QueryBuilder $qb, $table_alias=null)
{}
Builds a clause from closure or composite expression.
merge($parts=null, $boolean= 'AND')
Merges multiple composite expressions with a boolean.
_elgg_services()
Get the global service provider.
Builds queries to restrict access.