function update_get_update_function_list

Same name in other branches
  1. 9 core/includes/update.inc \update_get_update_function_list()
  2. 8.9.x core/includes/update.inc \update_get_update_function_list()
  3. 10 core/includes/update.inc \update_get_update_function_list()
  4. 11.x core/includes/update.inc \update_get_update_function_list()

Returns an organized list of update functions for a set of modules.

Parameters

$starting_updates: An array whose keys contain the names of modules and whose values contain the number of the first requested update for that module.

Return value

An array containing all the update functions that should be run for each module, including the provided starting update and all subsequent updates that are available. The keys of the array contain the module names, and each value is an ordered array of update functions, keyed by the update number.

See also

update_resolve_dependencies()

1 call to update_get_update_function_list()
update_resolve_dependencies in includes/update.inc
Resolves dependencies in a set of module updates, and orders them correctly.

File

includes/update.inc, line 1285

Code

function update_get_update_function_list($starting_updates) {
    // Go through each module and find all updates that we need (including the
    // first update that was requested and any updates that run after it).
    $update_functions = array();
    foreach ($starting_updates as $module => $version) {
        $update_functions[$module] = array();
        $updates = drupal_get_schema_versions($module);
        if ($updates !== FALSE) {
            $max_version = max($updates);
            if ($version <= $max_version) {
                foreach ($updates as $update) {
                    if ($update >= $version) {
                        $update_functions[$module][$update] = $module . '_update_' . $update;
                    }
                }
            }
        }
    }
    return $update_functions;
}

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