You are here

public function StatusOverride::getCacheableMetadata in Configuration Split 2.0.x

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

src/Config/StatusOverride.php, line 134

Class

StatusOverride
A config override for config split based on the drupal state.

Namespace

Drupal\config_split\Config

Code

public function getCacheableMetadata($name) {
  $metadata = new CacheableMetadata();
  $metadata
    ->setCacheTags([
    $this
      ->getCacheSuffix() . ':' . $name,
    'config:' . $name,
  ])
    ->setCacheMaxAge(Cache::PERMANENT);
  return $metadata;
}