You are here

protected function ProximityFilter::opRegex in Geolocation Field 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/views/filter/ProximityFilter.php \Drupal\geolocation\Plugin\views\filter\ProximityFilter::opRegex()
  2. 8.2 src/Plugin/views/filter/ProximityFilter.php \Drupal\geolocation\Plugin\views\filter\ProximityFilter::opRegex()

Filters by a regular expression.

Parameters

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

Overrides NumericFilter::opRegex

File

src/Plugin/views/filter/ProximityFilter.php, line 632

Class

ProximityFilter
Filter handler for search keywords.

Namespace

Drupal\geolocation\Plugin\views\filter

Code

protected function opRegex($expression) {

  /** @var \Drupal\views\Plugin\views\query\Sql $query */
  $query = $this->query;
  $query
    ->addWhereExpression($this->options['group'], $expression . ' ~* ' . $this->value['value']);
}