function UpdateRegistry::getModuleUpdateFunctions

Same name in other branches
  1. 9 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;
    });
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.