public function RefinableCacheableDependencyTrait::addCacheContexts in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php \Drupal\Core\Cache\RefinableCacheableDependencyTrait::addCacheContexts()
- 9 core/lib/Drupal/Core/Cache/RefinableCacheableDependencyTrait.php \Drupal\Core\Cache\RefinableCacheableDependencyTrait::addCacheContexts()
File
- core/
lib/ Drupal/ Core/ Cache/ RefinableCacheableDependencyTrait.php, line 31
Class
- RefinableCacheableDependencyTrait
- Trait for \Drupal\Core\Cache\RefinableCacheableDependencyInterface.
Namespace
Drupal\Core\CacheCode
public function addCacheContexts(array $cache_contexts) {
if ($cache_contexts) {
$this->cacheContexts = Cache::mergeContexts($this->cacheContexts, $cache_contexts);
}
return $this;
}