You are here

function search_api_solr_uninstall in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 search_api_solr.install \search_api_solr_uninstall()
  2. 8 search_api_solr.install \search_api_solr_uninstall()
  3. 7 search_api_solr.install \search_api_solr_uninstall()
  4. 4.x search_api_solr.install \search_api_solr_uninstall()

Implements hook_uninstall().

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\search_api\SearchApiException

File

./search_api_solr.install, line 132

Code

function search_api_solr_uninstall() {
  \Drupal::state()
    ->delete('search_api_solr.last_optimize');
  \Drupal::state()
    ->delete('search_api_solr.endpoint.data');
  foreach (search_api_solr_get_servers() as $server) {
    foreach ($server
      ->getIndexes() as $index) {
      \Drupal::state()
        ->delete('search_api_solr.' . $index
        ->id() . '.last_update');
    }
  }
}