function StorageReplaceDataWrapper::deleteAll

Same name in other branches
  1. 9 core/modules/config/src/StorageReplaceDataWrapper.php \Drupal\config\StorageReplaceDataWrapper::deleteAll()
  2. 10 core/modules/config/src/StorageReplaceDataWrapper.php \Drupal\config\StorageReplaceDataWrapper::deleteAll()
  3. 11.x 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 (strpos($name, $prefix) === 0) {
                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.