Commit | Line | Data |
---|---|---|
7f254ad8 AE |
1 | <?php |
2 | ||
3 | /** | |
4 | * @file | |
5 | * Contains views_handler_filter_tracker_boolean_operator | |
6 | */ | |
7 | ||
8 | /** | |
9 | * Filter handler for boolean values to use = 1 instead of <> 0. | |
10 | */ | |
11 | class views_handler_filter_tracker_boolean_operator extends views_handler_filter_boolean_operator { | |
12 | ||
13 | /** | |
14 | * Overrides views_handler_filter_boolean_operator::query(). | |
15 | */ | |
16 | function query() { | |
17 | $this->ensure_my_table(); | |
18 | $where = "$this->table_alias.$this->real_field "; | |
19 | if (empty($this->value)) { | |
20 | $where .= '= 0'; | |
21 | if ($this->accept_null) { | |
22 | $where = '(' . $where . " OR $this->table_alias.$this->real_field IS NULL)"; | |
23 | } | |
24 | } | |
25 | else { | |
26 | $where .= '= 1'; | |
27 | } | |
28 | $this->query->add_where_expression($this->options['group'], $where); | |
29 | } | |
30 | ||
31 | } |