function StorageReplaceDataWrapper::deleteAll

Same name in other branches
  1. 9 core/modules/config/src/StorageReplaceDataWrapper.php \Drupal\config\StorageReplaceDataWrapper::deleteAll()
  2. 8.9.x core/modules/config/src/StorageReplaceDataWrapper.php \Drupal\config\StorageReplaceDataWrapper::deleteAll()
  3. 10 core/modules/config/src/StorageReplaceDataWrapper.php \Drupal\config\StorageReplaceDataWrapper::deleteAll()

Overrides StorageInterface::deleteAll

File

core/modules/config/src/StorageReplaceDataWrapper.php, line 150

Class

StorageReplaceDataWrapper
Wraps a configuration storage to allow replacing specific configuration data.

Namespace

Drupal\config

Code

public function deleteAll($prefix = '') {
    if ($prefix === '') {
        $this->replacementData[$this->collection] = [];
    }
    else {
        foreach (array_keys($this->replacementData[$this->collection]) as $name) {
            if (str_starts_with($name, $prefix)) {
                unset($this->replacementData[$this->collection][$name]);
            }
        }
    }
    return $this->storage
        ->deleteAll($prefix);
}

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