function InOperator::operators

This kind of construct makes it relatively easy for a child class to add or remove functionality by overriding this function and adding/removing items from this array.

4 calls to InOperator::operators()
InOperator::adminSummary in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php
Display the filter on the administrative summary
InOperator::operator_options in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php
Build strings from the operators() for 'select' options
InOperator::operator_values in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php
InOperator::query in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php
Add this filter to the query.
1 method overrides InOperator::operators()
ManyToOne::operators in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/ManyToOne.php
This kind of construct makes it relatively easy for a child class to add or remove functionality by overriding this function and adding/removing items from this array.

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php, line 107
Definition of Drupal\views\Plugin\views\filter\InOperator.

Class

InOperator
Simple filter to handle matching of multiple options selectable via checkboxes

Namespace

Drupal\views\Plugin\views\filter

Code

function operators() {
  $operators = array(
    'in' => array(
      'title' => t('Is one of'),
      'short' => t('in'),
      'short_single' => t('='),
      'method' => 'op_simple',
      'values' => 1,
    ),
    'not in' => array(
      'title' => t('Is not one of'),
      'short' => t('not in'),
      'short_single' => t('<>'),
      'method' => 'op_simple',
      'values' => 1,
    ),
  );

  // if the definition allows for the empty operator, add it.
  if (!empty($this->definition['allow empty'])) {
    $operators += array(
      'empty' => array(
        'title' => t('Is empty (NULL)'),
        'method' => 'op_empty',
        'short' => t('empty'),
        'values' => 0,
      ),
      'not empty' => array(
        'title' => t('Is not empty (NOT NULL)'),
        'method' => 'op_empty',
        'short' => t('not empty'),
        'values' => 0,
      ),
    );
  }
  return $operators;
}