public function SearchApiUser::operators in Search API 8
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 InOperator::operators
File
- src/
Plugin/ views/ filter/ SearchApiUser.php, line 23
Class
- SearchApiUser
- Defines a filter for filtering on user references.
Namespace
Drupal\search_api\Plugin\views\filterCode
public function operators() {
return [
'or' => [
'title' => $this
->t('Is one of'),
'short' => $this
->t('or'),
'short_single' => $this
->t('='),
'method' => 'opHelper',
'values' => 1,
'ensure_my_table' => 'helper',
],
'and' => [
'title' => $this
->t('Is all of'),
'short' => $this
->t('and'),
'short_single' => $this
->t('='),
'method' => 'opHelper',
'values' => 1,
'ensure_my_table' => 'helper',
],
'not' => [
'title' => $this
->t('Is none of'),
'short' => $this
->t('not'),
'short_single' => $this
->t('<>'),
'method' => 'opHelper',
'values' => 1,
'ensure_my_table' => 'helper',
],
'empty' => [
'title' => $this
->t('Is empty (NULL)'),
'method' => 'opEmpty',
'short' => $this
->t('empty'),
'values' => 0,
],
'not empty' => [
'title' => $this
->t('Is not empty (NOT NULL)'),
'method' => 'opEmpty',
'short' => $this
->t('not empty'),
'values' => 0,
],
];
}