You are here

function bootstrap_site_alert_uninstall in Bootstrap Site Alert 8

Same name and namespace in other branches
  1. 8.2 bootstrap_site_alert.install \bootstrap_site_alert_uninstall()
  2. 7 bootstrap_site_alert.install \bootstrap_site_alert_uninstall()

Implements hook_uninstall().

File

./bootstrap_site_alert.install, line 22
The bootstrap_site_alert install file.

Code

function bootstrap_site_alert_uninstall() {

  // Remove state that the module has set.
  $string = 'bootstrap_site_alert';
  $database = \Drupal::database();
  $database
    ->delete('key_value')
    ->condition('name', $database
    ->escapeLike($string) . "%", 'LIKE')
    ->execute();

  // Remove settings. We switched to states in 8.x-1.3. Leaving this is for
  // older versions of the module.
  \Drupal::service('config.factory')
    ->getEditable('bootstrap_site_alert.settings')
    ->delete();
}