function UpdateRegistry::filterOutInvokedUpdatesByExtension

Same name in other branches
  1. 10 core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::filterOutInvokedUpdatesByExtension()
  2. 11.x core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::filterOutInvokedUpdatesByExtension()

Filters out already executed update functions by extension.

Parameters

string $extension: The extension name.

2 calls to UpdateRegistry::filterOutInvokedUpdatesByExtension()
UpdateRegistry::filterOutInvokedUpdatesByModule in core/lib/Drupal/Core/Update/UpdateRegistry.php
Filters out already executed update functions by module.
UpdateRegistry::onConfigSave in core/lib/Drupal/Core/Update/UpdateRegistry.php
Processes the list of installed extensions when core.extension changes.

File

core/lib/Drupal/Core/Update/UpdateRegistry.php, line 306

Class

UpdateRegistry
Provides all and missing update implementations.

Namespace

Drupal\Core\Update

Code

public function filterOutInvokedUpdatesByExtension(string $extension) {
    $existing_update_functions = $this->keyValue
        ->get('existing_updates', []);
    $remaining_update_functions = array_filter($existing_update_functions, function ($function_name) use ($extension) {
        return strpos($function_name, "{$extension}_{$this->updateType}_") !== 0;
    });
    $this->keyValue
        ->set('existing_updates', array_values($remaining_update_functions));
}

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