You are here

public function StorageComparer::getTargetStorage in Drupal 10

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

File

core/lib/Drupal/Core/Config/StorageComparer.php, line 126

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];
}