class ContextCacheKeys in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Cache/Context/ContextCacheKeys.php \Drupal\Core\Cache\Context\ContextCacheKeys
- 10 core/lib/Drupal/Core/Cache/Context/ContextCacheKeys.php \Drupal\Core\Cache\Context\ContextCacheKeys
A value object to store generated cache keys with its cacheability metadata.
Hierarchy
- class \Drupal\Core\Cache\CacheableMetadata implements RefinableCacheableDependencyInterface uses RefinableCacheableDependencyTrait
- class \Drupal\Core\Cache\Context\ContextCacheKeys
Expanded class hierarchy of ContextCacheKeys
1 file declares its use of ContextCacheKeys
- RendererTestBase.php in core/
tests/ Drupal/ Tests/ Core/ Render/ RendererTestBase.php - Contains \Drupal\Tests\Core\Render\RendererTestBase.
File
- core/
lib/ Drupal/ Core/ Cache/ Context/ ContextCacheKeys.php, line 10
Namespace
Drupal\Core\Cache\ContextView source
class ContextCacheKeys extends CacheableMetadata {
/**
* The generated cache keys.
*
* @var string[]
*/
protected $keys;
/**
* Constructs a ContextCacheKeys object.
*
* @param string[] $keys
* The cache context keys.
*/
public function __construct(array $keys) {
$this->keys = $keys;
}
/**
* Gets the generated cache keys.
*
* @return string[]
* The cache keys.
*/
public function getKeys() {
return $this->keys;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableDependencyTrait:: |
protected | property | Cache contexts. | |
CacheableDependencyTrait:: |
protected | property | Cache max-age. | |
CacheableDependencyTrait:: |
protected | property | Cache tags. | |
CacheableDependencyTrait:: |
protected | function | Sets cacheability; useful for value object constructors. | |
CacheableMetadata:: |
public | function | Applies the values of this CacheableMetadata object to a render array. | 1 |
CacheableMetadata:: |
public static | function | Creates a CacheableMetadata object from a depended object. | 1 |
CacheableMetadata:: |
public static | function | Creates a CacheableMetadata object with values taken from a render array. | 1 |
CacheableMetadata:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyTrait:: |
|
CacheableMetadata:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyTrait:: |
|
CacheableMetadata:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyTrait:: |
|
CacheableMetadata:: |
public | function | Merges the values of another CacheableMetadata object with this one. | 1 |
CacheableMetadata:: |
public | function | Sets cache contexts. | |
CacheableMetadata:: |
public | function | Sets the maximum age (in seconds). | |
CacheableMetadata:: |
public | function | Sets cache tags. | |
ContextCacheKeys:: |
protected | property | The generated cache keys. | |
ContextCacheKeys:: |
public | function | Gets the generated cache keys. | |
ContextCacheKeys:: |
public | function | Constructs a ContextCacheKeys object. | |
RefinableCacheableDependencyTrait:: |
public | function | 1 | |
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function |