function UpdateRegistry::getUpdateFunctions

Same name in other branches
  1. 10 core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::getUpdateFunctions()
  2. 11.x core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::getUpdateFunctions()

Returns all available updates for a given extension.

Parameters

string $extension_name: The extension name.

Return value

callable[] A list of update functions.

2 calls to UpdateRegistry::getUpdateFunctions()
UpdateRegistry::getModuleUpdateFunctions in core/lib/Drupal/Core/Update/UpdateRegistry.php
Returns all available updates for a given module.
UpdateRegistry::onConfigSave in core/lib/Drupal/Core/Update/UpdateRegistry.php
Processes the list of installed extensions when core.extension changes.

File

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

Class

UpdateRegistry
Provides all and missing update implementations.

Namespace

Drupal\Core\Update

Code

public function getUpdateFunctions($extension_name) {
    $this->scanExtensionsAndLoadUpdateFiles($extension_name);
    $all_functions = $this->getAvailableUpdateFunctions();
    return array_filter($all_functions, function ($function_name) use ($extension_name) {
        [
            $function_extension_name,
        ] = explode("_{$this->updateType}_", $function_name);
        return $function_extension_name === $extension_name;
    });
}

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