You are here

public function Search::getSuggesters in Search API Autocomplete 8

Retrieves this search's suggester plugins.

Return value

\Drupal\search_api_autocomplete\Suggester\SuggesterInterface[] The suggester plugins used by this search, keyed by plugin ID.

Overrides SearchInterface::getSuggesters

6 calls to Search::getSuggesters()
Search::addSuggester in src/Entity/Search.php
Adds a suggester to this search.
Search::getAllPlugins in src/Entity/Search.php
Retrieves all the plugins contained in this search entity.
Search::getSuggester in src/Entity/Search.php
Retrieves a specific suggester plugin for this search.
Search::isValidSuggester in src/Entity/Search.php
Determines whether the given suggester ID is valid for this search.
Search::preSave in src/Entity/Search.php
Acts on an entity before the presave hook is invoked.

... See full list

File

src/Entity/Search.php, line 222

Class

Search
Describes the autocomplete settings for a certain search.

Namespace

Drupal\search_api_autocomplete\Entity

Code

public function getSuggesters() {
  if ($this->suggesterInstances === NULL) {
    $this->suggesterInstances = \Drupal::getContainer()
      ->get('search_api_autocomplete.plugin_helper')
      ->createSuggesterPlugins($this, array_keys($this->suggester_settings));
  }
  return $this->suggesterInstances;
}