You are here

function pay_handler_filter_amount::op_between in Pay 7

Same name and namespace in other branches
  1. 6 includes/views/pay_handler_filter_amount.inc \pay_handler_filter_amount::op_between()

Overrides views_handler_filter_numeric::op_between

File

includes/views/pay_handler_filter_amount.inc, line 150

Class

pay_handler_filter_amount
Simple filter to handle greater than/less than filters

Code

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