function StringFilter::operator

Same name in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/filter/StringFilter.php \Drupal\views\Plugin\views\filter\StringFilter::operator()
  2. 10 core/modules/views/src/Plugin/views/filter/StringFilter.php \Drupal\views\Plugin\views\filter\StringFilter::operator()
  3. 11.x core/modules/views/src/Plugin/views/filter/StringFilter.php \Drupal\views\Plugin\views\filter\StringFilter::operator()

Get the query operator.

Return value

string Returns LIKE or NOT LIKE or the database specific equivalent based on the query's operator.

2 calls to StringFilter::operator()
Combine::opEqual in core/modules/views/src/Plugin/views/filter/Combine.php
Adds a where clause for the operation, 'equals'.
StringFilter::opEqual in core/modules/views/src/Plugin/views/filter/StringFilter.php
Adds a where clause for the operation, 'equals'.

File

core/modules/views/src/Plugin/views/filter/StringFilter.php, line 316

Class

StringFilter
Basic textfield filter to handle string filtering commands.

Namespace

Drupal\views\Plugin\views\filter

Code

public function operator() {
    return $this->getConditionOperator($this->operator == '=' ? 'LIKE' : 'NOT LIKE');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.