5 * Definition of views_handler_filter_group_by_numeric.
9 * Simple filter to handle greater than/less than filters
11 * @ingroup views_filter_handlers
13 class views_handler_filter_group_by_numeric extends views_handler_filter_numeric {
15 $this->ensure_my_table();
16 $field = $this->get_field();
18 $info = $this->operators();
19 if (!empty($info[$this->operator]['method'])) {
20 $this->{$info[$this->operator]['method']}($field);
23 function op_between($field) {
24 $placeholder_min = $this->placeholder();
25 $placeholder_max = $this->placeholder();
26 if ($this->operator == 'between') {
27 $this->query->add_having_expression($this->options['group'], "$field >= $placeholder_min", array($placeholder_min => $this->value['min']));
28 $this->query->add_having_expression($this->options['group'], "$field <= $placeholder_max", array($placeholder_max => $this->value['max']));
31 $this->query->add_having_expression($this->options['group'], "$field <= $placeholder_min OR $field >= $placeholder_max", array($placeholder_min => $this->value['min'], $placeholder_max => $this->value['max']));
35 function op_simple($field) {
36 $placeholder = $this->placeholder();
37 $this->query->add_having_expression($this->options['group'], "$field $this->operator $placeholder", array($placeholder => $this->value['value']));
40 function op_empty($field) {
41 if ($this->operator == 'empty') {
42 $operator = "IS NULL";
45 $operator = "IS NOT NULL";
48 $this->query->add_having_expression($this->options['group'], "$field $operator");
51 function ui_name($short = FALSE) {
52 return $this->get_field(parent::ui_name($short));
55 function can_group() { return FALSE; }