You are here

protected function Combine::opRegex in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/filter/Combine.php \Drupal\views\Plugin\views\filter\Combine::opRegex()
  2. 9 core/modules/views/src/Plugin/views/filter/Combine.php \Drupal\views\Plugin\views\filter\Combine::opRegex()

Filters by a regular expression.

Parameters

string $field: The expression pointing to the queries field, for example "foo.bar".

Overrides StringFilter::opRegex

File

core/modules/views/src/Plugin/views/filter/Combine.php, line 210

Class

Combine
Filter handler which allows to search on multiple fields.

Namespace

Drupal\views\Plugin\views\filter

Code

protected function opRegex($expression) {
  $placeholder = $this
    ->placeholder();
  $this->query
    ->addWhereExpression($this->options['group'], "{$expression} REGEXP {$placeholder}", [
    $placeholder => $this->value,
  ]);
}