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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Update!UpdateRegistry.php/function/UpdateRegistry::getModuleUpdateFunctions/8.1.x