public function BooleanOperatorString::query in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Plugin/views/filter/BooleanOperatorString.php \Drupal\views\Plugin\views\filter\BooleanOperatorString::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 BooleanOperator::query
File
- core/
modules/ views/ src/ Plugin/ views/ filter/ BooleanOperatorString.php, line 25 - Contains \Drupal\views\Plugin\views\filter\BooleanOperatorString.
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);
}