You are here

function search_api_disable in Search API 7

Implements hook_disable().

File

./search_api.install, line 439
Install, update and uninstall functions for the Search API module.

Code

function search_api_disable() {
  $types = array();
  foreach (search_api_index_load_multiple(FALSE) as $index) {
    $types[$index->item_type][] = $index;
  }
  foreach ($types as $type => $indexes) {
    try {
      $controller = search_api_get_datasource_controller($type);
      $controller
        ->stopTracking($indexes);
    } catch (SearchApiException $e) {

      // Modules defining entity or item types might have been disabled. Ignore.
    }
  }
}