function DbUpdatesTrait::includeUpdates

Conditionally load Update API functions for the specified group.

Parameters

string $module: The name of the module defining the update functions.

string $group: A name identifying the group of update functions to enable.

File

core/modules/system/src/Tests/Update/DbUpdatesTrait.php, line 55

Class

DbUpdatesTrait
Provides methods to conditionally enable db update functions and apply pending db updates through the Update UI.

Namespace

Drupal\system\Tests\Update

Code

public static function includeUpdates($module, $group) {
    if ($index = \Drupal::state()->get($module . '.db_updates.' . $group)) {
        module_load_include('inc', $module, 'update/' . $group . '_' . $index);
    }
}

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