summaryrefslogtreecommitdiffstats
path: root/handlers/views_handler_filter_boolean_operator_string.inc
blob: 2bea61682ab2f562a0c74e11587bf9839a676b38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
// $Id$
/**
 * Simple filter to handle matching of boolean values.
 *
 * This handler checks to see if a string field is empty (equal to '') or not.
 * It is otherwise identical to the parent operator.
 *
 * Definition items:
 * - label: (REQUIRED) The label for the checkbox.
 */
class views_handler_filter_boolean_operator_string extends views_handler_filter_boolean_operator {
  function query() {
    $this->ensure_my_table();
    $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field " . (empty($this->value) ? '=' : '<>') . " ''");
  }
}