LanguageConfigFactoryOverride::getOverride

public LanguageConfigFactoryOverride::getOverride($langcode, $name)

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

File

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

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;
}
doc_Drupal
2016-10-29 09:22:07
Comments
Leave a Comment

Please login to continue.