You are here

public function Search::getSearchPluginId in Search API Autocomplete 8

Retrieves the search plugin's ID.

Return value

string The ID of the search plugin used by this search.

Overrides SearchInterface::getSearchPluginId

5 calls to Search::getSearchPluginId()
Search::getAllPlugins in src/Entity/Search.php
Retrieves all the plugins contained in this search entity.
Search::getSearchPlugin in src/Entity/Search.php
Retrieves the search plugin.
Search::hasValidSearchPlugin in src/Entity/Search.php
Determines whether the search plugin set for this search is valid.
Search::invalidateTagsOnSave in src/Entity/Search.php
Override to never invalidate the entity's cache tag; the config system already invalidates it.
Search::preSave in src/Entity/Search.php
Acts on an entity before the presave hook is invoked.

File

src/Entity/Search.php, line 335

Class

Search
Describes the autocomplete settings for a certain search.

Namespace

Drupal\search_api_autocomplete\Entity

Code

public function getSearchPluginId() {
  if ($this->searchPlugin) {
    return $this->searchPlugin
      ->getPluginId();
  }
  reset($this->search_settings);
  return key($this->search_settings);
}