protected function range_handler_filter_numeric_range::op_within_query in Range 7
Operation query.
1 call to range_handler_filter_numeric_range::op_within_query()
- range_handler_filter_numeric_range::op_within in views/
range_handler_filter_numeric_range.inc - Operation callback.
1 method overrides range_handler_filter_numeric_range::op_within_query()
- range_search_api_handler_filter_numeric_range::op_within_query in views/
range_handler_filter_numeric_range.inc - Operation query.
File
- views/
range_handler_filter_numeric_range.inc, line 117 - Contains filter handlers for numeric range filters with views.
Class
- range_handler_filter_numeric_range
- Filter 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($this->options['group'], db_and()
->condition($field_from, $this->value, $op_left)
->condition($field_to, $this->value, $op_right));
}
else {
$this->query
->add_where($this->options['group'], db_or()
->condition($field_from, $this->value, $op_right)
->condition($field_to, $this->value, $op_left));
}
}