W3cubDocs

/Drupal 8

public function Condition::conditions

public &Condition::conditions()

Gets a complete list of all 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.

Overrides ConditionInterface::conditions

File

core/lib/Drupal/Core/Database/Query/Condition.php, line 130

Class

Condition
Generic class for a series of conditions in a query.

Namespace

Drupal\Core\Database\Query

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Database!Query!Condition.php/function/Condition::conditions/8.1.x