You are here

protected function range_handler_argument_numeric_range::op_within_query in Range 7

Operation query.

1 call to range_handler_argument_numeric_range::op_within_query()
range_handler_argument_numeric_range::query in views/range_handler_argument_numeric_range.inc
Set up the query for this argument.
1 method overrides range_handler_argument_numeric_range::op_within_query()
range_search_api_handler_argument_numeric_range::op_within_query in views/range_handler_argument_numeric_range.inc
Operation query.

File

views/range_handler_argument_numeric_range.inc, line 71
Contains argument handler for numeric range arguments with views.

Class

range_handler_argument_numeric_range
Argument handler for limiting a view to entities which lies within a range.

Code

protected function op_within_query($operator, $field_from, $field_to, $op_left, $op_right) {
  if ($operator === 'within') {
    $this->query
      ->add_where(0, db_and()
      ->condition($field_from, $this->argument, $op_left)
      ->condition($field_to, $this->argument, $op_right));
  }
  else {
    $this->query
      ->add_where(0, db_or()
      ->condition($field_from, $this->argument, $op_right)
      ->condition($field_to, $this->argument, $op_left));
  }
}