function BooleanOperator::query

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/filter/BooleanOperator.php \Drupal\views\Plugin\views\filter\BooleanOperator::query()
  2. 8.9.x core/modules/views/src/Plugin/views/filter/BooleanOperator.php \Drupal\views\Plugin\views\filter\BooleanOperator::query()
  3. 10 core/modules/views/src/Plugin/views/filter/BooleanOperator.php \Drupal\views\Plugin\views\filter\BooleanOperator::query()

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides FilterPluginBase::query

3 methods override BooleanOperator::query()
BooleanOperatorString::query in core/modules/views/src/Plugin/views/filter/BooleanOperatorString.php
Add this filter to the query.
Current::query in core/modules/user/src/Plugin/views/filter/Current.php
Add this filter to the query.
FilterBooleanOperatorDefaultTest::query in core/modules/views/tests/modules/views_test_data/src/Plugin/views/filter/FilterBooleanOperatorDefaultTest.php
Add this filter to the query.

File

core/modules/views/src/Plugin/views/filter/BooleanOperator.php, line 298

Class

BooleanOperator
Simple filter to handle matching of boolean values.

Namespace

Drupal\views\Plugin\views\filter

Code

public function query() {
  $this->ensureMyTable();
  $field = "{$this->tableAlias}.{$this->realField}";
  $info = $this->operators();
  if (!empty($info[$this->operator]['method'])) {
    $this->{$info[$this->operator]['method']}($field, $info[$this->operator]['query_operator'] ?? NULL);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.