You are here

public function UpdateRegistry::getModuleUpdateFunctions in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::getModuleUpdateFunctions()

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 245

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;
  });
}