You are here

function mongodb_watchdog_uninstall in MongoDB 8

Same name and namespace in other branches
  1. 8.2 modules/mongodb_watchdog/mongodb_watchdog.install \mongodb_watchdog_uninstall()
  2. 6 mongodb_watchdog/mongodb_watchdog.install \mongodb_watchdog_uninstall()
  3. 7 mongodb_watchdog/mongodb_watchdog.install \mongodb_watchdog_uninstall()

Implements hook_uninstall().

Drop /all/ the watchdog collections.

File

mongodb_watchdog/mongodb_watchdog.install, line 22
MongoDB watchdog install file.

Code

function mongodb_watchdog_uninstall() {

  /** @var \Drupal\mongodb\Logger\Logger $logger */
  $logger = \Drupal::service('mongo.logger');
  $count = $logger
    ->uninstall();
  if ($count) {
    drupal_set_message(\Drupal::translation()
      ->formatPlural($count, 'Dropped 1 watchdog collection', 'Dropped @count watchdog collections'));
  }
}