You are here

public function GoogleAnalyticsString::operators in Google Analytics Reports 8.3

Provides list of 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.

Overrides GoogleAnalyticsBase::operators

1 call to GoogleAnalyticsString::operators()
GoogleAnalyticsString::operatorValues in src/Plugin/views/filter/GoogleAnalyticsString.php
Operator values.

File

src/Plugin/views/filter/GoogleAnalyticsString.php, line 38

Class

GoogleAnalyticsString
Basic textfield filter to handle string filtering commands.

Namespace

Drupal\google_analytics_reports\Plugin\views\filter

Code

public function operators() {
  $operators = [
    '=' => [
      'title' => $this
        ->t('Is equal to'),
      'short' => $this
        ->t('='),
      'method' => 'opEqual',
      'values' => 1,
    ],
    '!=' => [
      'title' => $this
        ->t('Is not equal to'),
      'short' => $this
        ->t('!='),
      'method' => 'opInequal',
      'values' => 1,
    ],
    'contains' => [
      'title' => $this
        ->t('Contains'),
      'short' => $this
        ->t('contains'),
      'method' => 'opContains',
      'values' => 1,
    ],
    'not' => [
      'title' => $this
        ->t('Does not contain'),
      'short' => $this
        ->t('!has'),
      'method' => 'opNot',
      'values' => 1,
    ],
    'regular_expression' => [
      'title' => $this
        ->t('Contains a match for the regular expression'),
      'short' => $this
        ->t('regex'),
      'method' => 'opRegex',
      'values' => 1,
    ],
    'not_regular_expression' => [
      'title' => $this
        ->t('Does not match regular expression'),
      'short' => $this
        ->t('!regex'),
      'method' => 'opNotRegex',
      'values' => 1,
    ],
  ];
  return $operators;
}