function Context::addCacheableDependency
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Plugin/Context/Context.php \Drupal\Core\Plugin\Context\Context::addCacheableDependency()
- 10 core/lib/Drupal/Core/Plugin/Context/Context.php \Drupal\Core\Plugin\Context\Context::addCacheableDependency()
- 11.x core/lib/Drupal/Core/Plugin/Context/Context.php \Drupal\Core\Plugin\Context\Context::addCacheableDependency()
Overrides ContextInterface::addCacheableDependency
1 call to Context::addCacheableDependency()
- Context::setContextValue in core/
lib/ Drupal/ Core/ Plugin/ Context/ Context.php - Sets the context value.
File
-
core/
lib/ Drupal/ Core/ Plugin/ Context/ Context.php, line 145
Class
- Context
- A Drupal specific context wrapper class.
Namespace
Drupal\Core\Plugin\ContextCode
public function addCacheableDependency($dependency) {
$this->cacheabilityMetadata = $this->cacheabilityMetadata
->merge(CacheableMetadata::createFromObject($dependency));
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.