3 namespace Drupal\views\Plugin\views\filter;
6 * Simple filter to handle matching of boolean values.
8 * This handler checks to see if a string field is empty (equal to '') or not.
9 * It is otherwise identical to the parent operator.
12 * - label: (REQUIRED) The label for the checkbox.
14 * @ingroup views_filter_handlers
16 * @ViewsFilter("boolean_string")
18 class BooleanOperatorString extends BooleanOperator {
20 public function query() {
21 $this->ensureMyTable();
22 $where = "$this->tableAlias.$this->realField ";
24 if (empty($this->value)) {
26 if ($this->accept_null) {
27 $where = '(' . $where . " OR $this->tableAlias.$this->realField IS NULL)";
33 $this->query->addWhereExpression($this->options['group'], $where);