function LanguageConfigFactoryOverride::getCacheableMetadata

Same name in other branches
  1. 9 core/modules/language/src/Config/LanguageConfigFactoryOverride.php \Drupal\language\Config\LanguageConfigFactoryOverride::getCacheableMetadata()
  2. 10 core/modules/language/src/Config/LanguageConfigFactoryOverride.php \Drupal\language\Config\LanguageConfigFactoryOverride::getCacheableMetadata()
  3. 11.x core/modules/language/src/Config/LanguageConfigFactoryOverride.php \Drupal\language\Config\LanguageConfigFactoryOverride::getCacheableMetadata()

Overrides ConfigFactoryOverrideInterface::getCacheableMetadata

File

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

Class

LanguageConfigFactoryOverride
Provides language overrides for the configuration factory.

Namespace

Drupal\language\Config

Code

public function getCacheableMetadata($name) {
    $metadata = new CacheableMetadata();
    if ($this->language) {
        $metadata->setCacheContexts([
            'languages:language_interface',
        ]);
    }
    return $metadata;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.