ModuleInstaller::validateUninstall

public ModuleInstaller::validateUninstall(array $module_list)

Determines whether a list of modules can be uninstalled.

Parameters

string[] $module_list: An array of module names.

Return value

string[] An array of reasons the module can not be uninstalled, empty if it can.

Overrides ModuleInstallerInterface::validateUninstall

File

core/lib/Drupal/Core/Extension/ModuleInstaller.php, line 550

Class

ModuleInstaller
Default implementation of the module installer.

Namespace

Drupal\Core\Extension

Code

public function validateUninstall(array $module_list) {
  $reasons = array();
  foreach ($module_list as $module) {
    foreach ($this->uninstallValidators as $validator) {
      $validation_reasons = $validator->validate($module);
      if (!empty($validation_reasons)) {
        if (!isset($reasons[$module])) {
          $reasons[$module] = array();
        }
        $reasons[$module] = array_merge($reasons[$module], $validation_reasons);
      }
    }
  }
  return $reasons;
}
doc_Drupal
2016-10-29 09:29:25
Comments
Leave a Comment

Please login to continue.