Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ContextCacheKeys.php

function ContextCacheKeys::__construct

Constructs a ContextCacheKeys object.

Parameters

string[] $keys: The cache context keys.

File

core/lib/Drupal/Core/Cache/Context/ContextCacheKeys.php, line 25

Class

ContextCacheKeys
A value object to store generated cache keys with its cacheability metadata.

Namespace

Drupal\Core\Cache\Context

Code

public function __construct(array $keys) {
    // Domain invariant: cache keys must be always sorted.
    // Sorting keys warrants that different combination of the same keys
    // generates the same cache cid.
    // @see \Drupal\Core\Render\RenderCache::createCacheID()
    sort($keys);
    $this->keys = $keys;
}
RSS feed
Powered by Drupal