public function SocialSimpleBlock::getCacheTags in Social simple 8
Same name and namespace in other branches
- 2.0.x src/Plugin/Block/SocialSimpleBlock.php \Drupal\social_simple\Plugin\Block\SocialSimpleBlock::getCacheTags()
The cache tags associated with this object.
When this object is modified, these cache tags will be invalidated.
Return value
string[] A set of cache tags.
Overrides ContextAwarePluginBase::getCacheTags
File
- src/
Plugin/ Block/ SocialSimpleBlock.php, line 181
Class
- SocialSimpleBlock
- Provides a 'SocialSimpleBlock' block.
Namespace
Drupal\social_simple\Plugin\BlockCode
public function getCacheTags() {
/** @var \Drupal\node\NodeInterface $node */
if ($node = $this->currentRouteMatch
->getParameter('node')) {
return Cache::mergeTags(parent::getCacheTags(), $node
->getCacheTags());
}
elseif ($taxonomy_term = $this->currentRouteMatch
->getParameter('taxonomy_term')) {
return Cache::mergeTags(parent::getCacheTags(), $taxonomy_term
->getCacheTags());
}
else {
return parent::getCacheTags();
}
}