You are here

public function StorageComparer::getTargetStorage in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Config/StorageComparer.php \Drupal\Core\Config\StorageComparer::getTargetStorage()

Gets the configuration target storage.

Parameters

string $collection: (optional) The storage collection to use. Defaults to the default collection.

Return value

\Drupal\Core\Config\StorageInterface Storage object used to write configuration.

Overrides StorageComparerInterface::getTargetStorage

1 call to StorageComparer::getTargetStorage()
StorageComparer::getAndSortConfigData in core/lib/Drupal/Core/Config/StorageComparer.php
Gets and sorts configuration data from the source and target storages.

File

core/lib/Drupal/Core/Config/StorageComparer.php, line 141
Contains \Drupal\Core\Config\StorageComparer.

Class

StorageComparer
Defines a config storage comparer.

Namespace

Drupal\Core\Config

Code

public function getTargetStorage($collection = StorageInterface::DEFAULT_COLLECTION) {
  if (!isset($this->targetStorages[$collection])) {
    if ($collection == StorageInterface::DEFAULT_COLLECTION) {
      $this->targetStorages[$collection] = $this->targetStorage;
    }
    else {
      $this->targetStorages[$collection] = $this->targetStorage
        ->createCollection($collection);
    }
  }
  return $this->targetStorages[$collection];
}