You are here

public function SearchApiDate::acceptExposedInput in Search API 8

Do some minor translation of the exposed input

Overrides Date::acceptExposedInput

File

src/Plugin/views/filter/SearchApiDate.php, line 69

Class

SearchApiDate
Defines a filter for filtering on dates.

Namespace

Drupal\search_api\Plugin\views\filter

Code

public function acceptExposedInput($input) {
  if (empty($this->options['exposed'])) {
    return TRUE;
  }
  $return = parent::acceptExposedInput($input);
  if (!$return) {

    // Override for the "(not) empty" operators.
    $operators = $this
      ->operators();
    if ($operators[$this->operator]['values'] == 0) {
      return TRUE;
    }
  }
  return $return;
}