You are here

public function LanguageConfigFactoryOverride::getOverride in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/language/src/Config/LanguageConfigFactoryOverride.php \Drupal\language\Config\LanguageConfigFactoryOverride::getOverride()

Get language override for given language and configuration name.

Parameters

string $langcode: Language code.

string $name: Configuration name.

Return value

\Drupal\Core\Config\Config Configuration override object.

Overrides LanguageConfigFactoryOverrideInterface::getOverride

4 calls to LanguageConfigFactoryOverride::getOverride()
LanguageConfigFactoryOverride::createConfigObject in core/modules/language/src/Config/LanguageConfigFactoryOverride.php
Creates a configuration object for use during install and synchronization.
LanguageConfigFactoryOverride::onConfigDelete in core/modules/language/src/Config/LanguageConfigFactoryOverride.php
Actions to be performed to configuration override on configuration delete.
LanguageConfigFactoryOverride::onConfigRename in core/modules/language/src/Config/LanguageConfigFactoryOverride.php
Actions to be performed to configuration override on configuration rename.
LanguageConfigFactoryOverride::onConfigSave in core/modules/language/src/Config/LanguageConfigFactoryOverride.php
Actions to be performed to configuration override on configuration save.

File

core/modules/language/src/Config/LanguageConfigFactoryOverride.php, line 97

Class

LanguageConfigFactoryOverride
Provides language overrides for the configuration factory.

Namespace

Drupal\language\Config

Code

public function getOverride($langcode, $name) {
  $storage = $this
    ->getStorage($langcode);
  $data = $storage
    ->read($name);
  $override = new LanguageConfigOverride($name, $storage, $this->typedConfigManager, $this->eventDispatcher);
  if (!empty($data)) {
    $override
      ->initWithData($data);
  }
  return $override;
}