You are here

public static function DbUpdatesTrait::includeUpdates in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Update/DbUpdatesTrait.php \Drupal\system\Tests\Update\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.

1 call to DbUpdatesTrait::includeUpdates()
entity_test.install in core/modules/system/tests/modules/entity_test/entity_test.install
Install, update and uninstall functions for the entity_test module.

File

core/modules/system/src/Tests/Update/DbUpdatesTrait.php, line 54
Contains \Drupal\system\Tests\Update\DbUpdatesTrait.

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