You are here

public function Search::isValidSuggester in Search API Autocomplete 8

Determines whether the given suggester ID is valid for this search.

The general contract of this method is that it should return TRUE if, and only if, a call to getSuggester() with the same ID would not result in an exception.

Parameters

string $suggester_id: A suggester plugin ID.

Return value

bool TRUE if the suggester with the given ID is enabled for this search and can be loaded. FALSE otherwise.

Overrides SearchInterface::isValidSuggester

File

src/Entity/Search.php, line 245

Class

Search
Describes the autocomplete settings for a certain search.

Namespace

Drupal\search_api_autocomplete\Entity

Code

public function isValidSuggester($suggester_id) {
  $suggesters = $this
    ->getSuggesters();
  return !empty($suggesters[$suggester_id]);
}