Allows to add cacheability metadata to an object for the current runtime.
This must be used when changing an object in a way that affects its cacheability. For example, when changing the active translation of an entity based on the current content language then a cache context for that must be added.
Hierarchy
- interface \Drupal\Core\Cache\CacheableDependencyInterface
- interface \Drupal\Core\Cache\RefinableCacheableDependencyInterface
File
- core/lib/Drupal/Core/Cache/RefinableCacheableDependencyInterface.php, line 13
Namespace
Drupal\Core\Cache
Members
Name | Modifiers | Type | Description |
---|---|---|---|
CacheableDependencyInterface::getCacheContexts | public | function | The cache contexts associated with this object. |
CacheableDependencyInterface::getCacheMaxAge | public | function | The maximum age for which this object may be cached. |
CacheableDependencyInterface::getCacheTags | public | function | The cache tags associated with this object. |
RefinableCacheableDependencyInterface::addCacheableDependency | public | function | Adds a dependency on an object: merges its cacheability metadata. |
RefinableCacheableDependencyInterface::addCacheContexts | public | function | Adds cache contexts. |
RefinableCacheableDependencyInterface::addCacheTags | public | function | Adds cache tags. |
RefinableCacheableDependencyInterface::mergeCacheMaxAge | public | function | Merges the maximum age (in seconds) with the existing maximum age. |
Please login to continue.