You are here

public function DomainConfigOverrider::getCacheableMetadata in Domain Access 8

Gets the cacheability metadata associated with the config factory override.

Parameters

string $name: The name of the configuration override to get metadata for.

Return value

\Drupal\Core\Cache\CacheableMetadata A cacheable metadata object.

Overrides ConfigFactoryOverrideInterface::getCacheableMetadata

File

domain_config/src/DomainConfigOverrider.php, line 203

Class

DomainConfigOverrider
Domain-specific config overrides.

Namespace

Drupal\domain_config

Code

public function getCacheableMetadata($name) {
  if (empty($this->contextSet)) {
    $this
      ->initiateContext();
  }
  $metadata = new CacheableMetadata();
  if (!empty($this->domain)) {
    $metadata
      ->addCacheContexts([
      'url.site',
      'languages:language_interface',
    ]);
  }
  return $metadata;
}