You are here

protected function Range::operators in Range 8

Same name in this branch
  1. 8 src/Plugin/views/filter/Range.php \Drupal\range\Plugin\views\filter\Range::operators()
  2. 8 src/Plugin/views/argument/Range.php \Drupal\range\Plugin\views\argument\Range::operators()

Define the operators supported for ranges.

2 calls to Range::operators()
Range::operatorOptions in src/Plugin/views/filter/Range.php
Provide a list of options for the default operator form. Should be overridden by classes that don't override operatorForm
Range::query in src/Plugin/views/filter/Range.php
Add this filter to the query.

File

src/Plugin/views/filter/Range.php, line 130

Class

Range
Range views filter.

Namespace

Drupal\range\Plugin\views\filter

Code

protected function operators() {
  $operators = [
    'within' => [
      'title' => $this
        ->t('Range contains'),
      'short' => $this
        ->t('contains'),
      'method' => 'opWithin',
      'values' => 1,
    ],
    'not within' => [
      'title' => $this
        ->t('Range does not contain'),
      'short' => $this
        ->t('does not contain'),
      'method' => 'opWithin',
      'values' => 1,
    ],
  ];
  return $operators;
}