You are here

function views_handler_filter_float::op_between in Views (for Drupal 7) 6.2

Same name and namespace in other branches
  1. 6.3 handlers/views_handler_filter_float.inc \views_handler_filter_float::op_between()

Overrides views_handler_filter_numeric::op_between

File

handlers/views_handler_filter_float.inc, line 9

Class

views_handler_filter_float
Simple filter to handle greater than/less than filters. It based on views_handler_filter_numeric but deals with float numbers.

Code

function op_between($field) {
  if ($this->operator == 'between') {
    $this->query
      ->add_where($this->options['group'], "{$field} >= %f", $this->value['min']);
    $this->query
      ->add_where($this->options['group'], "{$field} <= %f", $this->value['max']);
  }
  else {
    $this->query
      ->add_where($this->options['group'], "{$field} <= %f OR {$field} >= %f", $this->value['min'], $this->value['max']);
  }
}