You are here

public function ConfigSplitManager::getSplitConfig in Configuration Split 2.0.x

Get a split from a name.

Parameters

string $name: The name of the split.

\Drupal\Core\Config\StorageInterface $storage: The storage to get a split from if not the active one.

Return value

\Drupal\Core\Config\ImmutableConfig|null The split config.

3 calls to ConfigSplitManager::getSplitConfig()
ConfigSplitManager::exportTransform in src/ConfigSplitManager.php
Process the export of a split.
ConfigSplitManager::getSplitEntity in src/ConfigSplitManager.php
Get a split entity.
ConfigSplitManager::importTransform in src/ConfigSplitManager.php
Process the import of a split.

File

src/ConfigSplitManager.php, line 130

Class

ConfigSplitManager
The manager to split and merge.

Namespace

Drupal\config_split

Code

public function getSplitConfig(string $name, StorageInterface $storage = NULL) : ?ImmutableConfig {
  if (strpos($name, 'config_split.config_split.') !== 0) {
    $name = 'config_split.config_split.' . $name;
  }
  if (!in_array($name, $this->factory
    ->listAll('config_split.config_split.'), TRUE)) {
    return NULL;
  }
  return $this->factory
    ->get($name);
}