UpdateRegistry::getModuleUpdateFunctions

public UpdateRegistry::getModuleUpdateFunctions($module_name)

Returns all available updates for a given module.

Parameters

string $module_name: The module name.

Return value

callable[] A list of update functions.

File

core/lib/Drupal/Core/Update/UpdateRegistry.php, line 224

Class

UpdateRegistry
Provides all and missing update implementations.

Namespace

Drupal\Core\Update

Code

public function getModuleUpdateFunctions($module_name) {
  $this->scanExtensionsAndLoadUpdateFiles();
  $all_functions = $this->getAvailableUpdateFunctions();

  return array_filter($all_functions, function($function_name) use ($module_name) {
    list($function_module_name, ) = explode("_{$this->updateType}_", $function_name);
    return $function_module_name === $module_name;
  });
}
doc_Drupal
2016-10-29 09:51:12
Comments
Leave a Comment

Please login to continue.