You are here

function apachesolr_environment_delete in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 apachesolr.module \apachesolr_environment_delete()
  2. 6.3 apachesolr.module \apachesolr_environment_delete()

Function that deletes an environment

Parameters

$env_id: The environment ID it needs to delete.

2 calls to apachesolr_environment_delete()
apachesolr_ctools_environment_delete in ./apachesolr.module
Callback for reverting Apache Solr environment CTools exportables.
apachesolr_environment_delete_form_submit in ./apachesolr.admin.inc
Submit handler for the delete form

File

./apachesolr.module, line 1300
Integration with the Apache Solr search application.

Code

function apachesolr_environment_delete($env_id) {
  $environment = apachesolr_environment_load($env_id);
  if ($environment) {
    db_delete('apachesolr_environment')
      ->condition('env_id', $env_id)
      ->execute();
    db_delete('apachesolr_environment_variable')
      ->condition('env_id', $env_id)
      ->execute();
    db_delete('apachesolr_index_bundles')
      ->condition('env_id', $env_id)
      ->execute();
    module_invoke_all('apachesolr_environment_delete', $environment);
    apachesolr_environments_clear_cache();
  }
}