You are here

function _search_api_view_crud_event in Search API 8

Reacts to a view CRUD event.

Parameters

\Drupal\views\ViewEntityInterface $view: The view that was created, changed or deleted.

3 calls to _search_api_view_crud_event()
search_api_view_delete in ./search_api.module
Implements hook_ENTITY_TYPE_delete() for type "view".
search_api_view_insert in ./search_api.module
Implements hook_ENTITY_TYPE_insert() for type "view".
search_api_view_update in ./search_api.module
Implements hook_ENTITY_TYPE_update() for type "view".

File

./search_api.module, line 464
Provides a rich framework for creating searches.

Code

function _search_api_view_crud_event(ViewEntityInterface $view) {

  // Whenever a view is created, updated (displays might have been added or
  // removed) or deleted, we need to clear our cached display definitions.
  if (SearchApiQuery::getIndexFromTable($view
    ->get('base_table'))) {
    \Drupal::getContainer()
      ->get('plugin.manager.search_api.display')
      ->clearCachedDefinitions();
  }
}