function StorageReplaceDataWrapper::listAll

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

Overrides StorageInterface::listAll

File

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

Class

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

Namespace

Drupal\config

Code

public function listAll($prefix = '') {
    $names = $this->storage
        ->listAll($prefix);
    $additional_names = [];
    if ($prefix === '') {
        $additional_names = array_keys($this->replacementData[$this->collection]);
    }
    else {
        foreach (array_keys($this->replacementData[$this->collection]) as $name) {
            if (strpos($name, $prefix) === 0) {
                $additional_names[] = $name;
            }
        }
    }
    if (!empty($additional_names)) {
        $names = array_unique(array_merge($names, $additional_names));
    }
    return $names;
}

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