function search_api_autocomplete_view_insert in Search API Autocomplete 8
Implements hook_ENTITY_TYPE_insert() for type "view".
Clear the search plugin definitions cache when new search views are created. Could use better support from the Plugin API – see #2633878.
File
- ./
search_api_autocomplete.module, line 199 - Adds autocomplete capabilities for Search API searches.
Code
function search_api_autocomplete_view_insert(ViewEntityInterface $view) {
if (SearchApiQuery::getIndexFromTable($view
->get('base_table'))) {
\Drupal::getContainer()
->get('plugin.manager.search_api_autocomplete.search')
->clearCachedDefinitions();
SearchPluginDeriverBase::resetStaticDerivativeCaches('views');
}
}