You are here

public function DataPolicyModuleInstaller::uninstall in Data Policy 8

Same name in this branch
  1. 8 src/DataPolicyModuleInstaller.php \Drupal\data_policy\DataPolicyModuleInstaller::uninstall()
  2. 8 src/ProxyClass/DataPolicyModuleInstaller.php \Drupal\data_policy\ProxyClass\DataPolicyModuleInstaller::uninstall()

Uninstalls a given list of modules.

Parameters

string[] $module_list: The modules to uninstall.

bool $uninstall_dependents: (optional) If TRUE, dependent modules will automatically be uninstalled in the correct order. This incurs a significant performance cost, so use FALSE if you know $module_list is already complete.

Return value

bool FALSE if one or more dependencies are missing, TRUE otherwise.

Overrides ModuleInstaller::uninstall

See also

hook_module_preuninstall()

hook_uninstall()

hook_modules_uninstalled()

File

src/DataPolicyModuleInstaller.php, line 58

Class

DataPolicyModuleInstaller
Class DataPolicyModuleInstaller.

Namespace

Drupal\data_policy

Code

public function uninstall(array $module_list, $uninstall_dependents = TRUE) {
  if (in_array('data_policy', $module_list) && $this->entityId) {
    $this->storage
      ->load($this->entityId)
      ->delete();
  }
  parent::uninstall($module_list, $uninstall_dependents);
}