SearchApiString.php in Search API 8
File
src/Plugin/views/filter/SearchApiString.php
View source
<?php
namespace Drupal\search_api\Plugin\views\filter;
class SearchApiString extends SearchApiNumeric {
protected function opBetween($field) {
if ($this->value['min'] != '' && $this->value['max'] != '') {
$operator = $this->operator == 'between' ? 'BETWEEN' : 'NOT BETWEEN';
$this
->getQuery()
->addWhere($this->options['group'], $field, [
$this->value['min'],
$this->value['max'],
], $operator);
}
elseif ($this->value['min'] != '') {
$operator = $this->operator == 'between' ? '>=' : '<';
$this
->getQuery()
->addWhere($this->options['group'], $field, $this->value['min'], $operator);
}
elseif ($this->value['max'] != '') {
$operator = $this->operator == 'between' ? '<=' : '>';
$this
->getQuery()
->addWhere($this->options['group'], $field, $this->value['max'], $operator);
}
}
}
Classes
Name |
Description |
SearchApiString |
Defines a filter for adding conditions on string fields to the query. |