You are here

function search_api_autocomplete_suggester_load in Search API Autocomplete 7

Loads the specified suggester plugin.

Parameters

string $suggester_id: The ID of the suggester plugin to load.

SearchApiAutocompleteSearch $search: The search for which to create a suggester.

array $configuration: The configuration for the search.

Return value

SearchApiAutocompleteSuggesterInterface|null The loaded suggester plugin, or NULL if it could not be loaded.

4 calls to search_api_autocomplete_suggester_load()
SearchApiAutocompleteSearch::getSuggester in ./search_api_autocomplete.entity.php
Retrieves the suggester plugin for this search.
search_api_autocomplete_admin_search_edit in ./search_api_autocomplete.admin.inc
Form for editing the autocompletion settings for a search.
search_api_autocomplete_admin_search_edit_submit in ./search_api_autocomplete.admin.inc
Submit callback for search_api_autocomplete_admin_search_edit().
search_api_autocomplete_admin_search_edit_validate in ./search_api_autocomplete.admin.inc
Validate callback for search_api_autocomplete_admin_search_edit().

File

./search_api_autocomplete.module, line 297
Adds autocomplete capabilities for Search API searches.

Code

function search_api_autocomplete_suggester_load($suggester_id, SearchApiAutocompleteSearch $search, array $configuration) {
  $definition = search_api_autocomplete_suggester_info($suggester_id);
  if (!$definition) {
    return NULL;
  }
  return call_user_func(array(
    $definition['class'],
    'create',
  ), $search, $configuration, $suggester_id, $definition);
}