function UpdateRegistry::filterOutInvokedUpdatesByExtension

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Update/UpdateRegistry.php \Drupal\Core\Update\UpdateRegistry::filterOutInvokedUpdatesByExtension()
  2. 10 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.

1 call to UpdateRegistry::filterOutInvokedUpdatesByExtension()
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 278

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 !str_starts_with($function_name, "{$extension}_{$this->updateType}_");
    });
    $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.