Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Database/Query/SelectExtender.php \Drupal\Core\Database\Query\SelectExtender::conditions()
  2. 9 core/lib/Drupal/Core/Database/Query/SelectExtender.php \Drupal\Core\Database\Query\SelectExtender::conditions()

Gets the, possibly nested, list of conditions in this conditional clause.

This method returns by reference. That allows alter hooks to access the data structure directly and manipulate it before it gets compiled.

The data structure that is returned is an indexed array of entries, where each entry looks like the following:

array(
  'field' => $field,
  'value' => $value,
  'operator' => $operator,
);

In the special case that $operator is NULL, the $field is taken as a raw SQL snippet (possibly containing a function) and $value is an associative array of placeholders for the snippet.

There will also be a single array entry of #conjunction, which is the conjunction that will be applied to the array, such as AND.

Return value

array The, possibly nested, list of all conditions (by reference).

Overrides ConditionInterface::conditions

1 method overrides SelectExtender::conditions()
ViewsSearchQuery::conditions in core/modules/search/src/ViewsSearchQuery.php
Returns the conditions property.

File

core/lib/Drupal/Core/Database/Query/SelectExtender.php, line 115

Class

SelectExtender
The base extender class for Select queries.

Namespace

Drupal\Core\Database\Query

Code

public function &conditions() {
  return $this->query
    ->conditions();
}