public function BooleanOperatorString::query in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/src/Plugin/views/filter/BooleanOperatorString.php \Drupal\views\Plugin\views\filter\BooleanOperatorString::query()
- 9 core/modules/views/src/Plugin/views/filter/BooleanOperatorString.php \Drupal\views\Plugin\views\filter\BooleanOperatorString::query()
File
- core/
modules/ views/ src/ Plugin/ views/ filter/ BooleanOperatorString.php, line 20
Class
- BooleanOperatorString
- Simple filter to handle matching of boolean values.
Namespace
Drupal\views\Plugin\views\filterCode
public function query() {
$this
->ensureMyTable();
$where = "{$this->tableAlias}.{$this->realField} ";
if (empty($this->value)) {
$where .= "= ''";
if ($this->accept_null) {
$where = '(' . $where . " OR {$this->tableAlias}.{$this->realField} IS NULL)";
}
}
else {
$where .= "<> ''";
}
$this->query
->addWhereExpression($this->options['group'], $where);
}