You are here

public static function DbUpdatesTrait::includeUpdates in Drupal 8

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