You are here

function String::operators in EntityFieldQuery Views Backend 8

We don't support every operator from the parent class ("not between", for example), hence the need to define only the operators we do support.

Overrides String::operators

1 call to String::operators()
String::query in src/Plugin/views/filter/String.php
Add this filter to the query.

File

src/Plugin/views/filter/String.php, line 25
Contains \Drupal\efq_views\Plugin\views\filter\String.

Class

String
Filter handler for string.

Namespace

Drupal\efq_views\Plugin\views\filter

Code

function operators() {
  $operators = array(
    '=' => array(
      'title' => t('Is equal to'),
      'short' => t('='),
      'method' => 'op_simple',
      'values' => 1,
    ),
    '<>' => array(
      'title' => t('Is not equal to'),
      'short' => t('!='),
      'method' => 'op_simple',
      'values' => 1,
    ),
    'CONTAINS' => array(
      'title' => t('Contains'),
      'short' => t('contains'),
      'method' => 'op_simple',
      'values' => 1,
    ),
    'STARTS_WITH' => array(
      'title' => t('Starts with'),
      'short' => t('begins'),
      'method' => 'op_simple',
      'values' => 1,
    ),
  );
  return $operators;
}