You are here

public function WebformSubmissionNumericFilter::opBetween in Webform Views Integration 8.5

Filters by operator between.

Parameters

object $field: The views field.

Overrides NumericFilter::opBetween

File

src/Plugin/views/filter/WebformSubmissionNumericFilter.php, line 109

Class

WebformSubmissionNumericFilter
Filter based on numeric value of a webform submission.

Namespace

Drupal\webform_views\Plugin\views\filter

Code

public function opBetween($field) {
  if ($this->definition['explicit_cast']) {
    $operator = $this->operator == 'between' ? 'BETWEEN' : 'NOT BETWEEN';
    $this->query
      ->addWhereExpression($this->options['group'], $this
      ->castToDataType($field) . ' ' . $operator . ' ' . $this
      ->castToDataType(':min') . ' AND ' . $this
      ->castToDataType(':max'), [
      ':min' => $this->value['min'],
      ':max' => $this->value['max'],
    ]);
  }
  else {
    parent::opBetween($field);
  }
}