function ManagedStorage::getStorage

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Config/ManagedStorage.php \Drupal\Core\Config\ManagedStorage::getStorage()
  2. 8.9.x core/lib/Drupal/Core/Config/ManagedStorage.php \Drupal\Core\Config\ManagedStorage::getStorage()
  3. 10 core/lib/Drupal/Core/Config/ManagedStorage.php \Drupal\Core\Config\ManagedStorage::getStorage()

Get the decorated storage from the manager if necessary.

Return value

\Drupal\Core\Config\StorageInterface The config storage.

File

core/lib/Drupal/Core/Config/ManagedStorage.php, line 143

Class

ManagedStorage
The managed storage defers all the storage method calls to the manager.

Namespace

Drupal\Core\Config

Code

protected function getStorage() {
    // Get the storage from the manager the first time it is needed.
    if (!isset($this->storage)) {
        $this->storage = $this->manager
            ->getStorage();
    }
    return $this->storage;
}

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