public static function TestSuggester::supportsSearch in Search API Autocomplete 8
Determines whether this plugin supports the given search.
Parameters
\Drupal\search_api_autocomplete\SearchInterface $search: The search in question.
Return value
bool TRUE if this plugin supports the given search, FALSE otherwise.
Overrides SuggesterPluginBase::supportsSearch
File
- tests/
search_api_autocomplete_test/ src/ Plugin/ search_api_autocomplete/ suggester/ TestSuggester.php, line 30
Class
- TestSuggester
- Defines a test suggester class.
Namespace
Drupal\search_api_autocomplete_test\Plugin\search_api_autocomplete\suggesterCode
public static function supportsSearch(SearchInterface $search) {
$key = 'search_api_test.suggester.method.' . __FUNCTION__;
$override = \Drupal::state()
->get($key);
if ($override) {
return call_user_func($override, $search);
}
return TRUE;
}