You are here

public function ContextAwarePluginBase::getCacheTags in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php \Drupal\Core\Plugin\ContextAwarePluginBase::getCacheTags()
4 calls to ContextAwarePluginBase::getCacheTags()
AggregatorFeedBlock::getCacheTags in core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
ForumBlockBase::getCacheTags in core/modules/forum/src/Plugin/Block/ForumBlockBase.php
SystemBrandingBlock::getCacheTags in core/modules/system/src/Plugin/Block/SystemBrandingBlock.php
SystemMenuBlock::getCacheTags in core/modules/system/src/Plugin/Block/SystemMenuBlock.php
4 methods override ContextAwarePluginBase::getCacheTags()
AggregatorFeedBlock::getCacheTags in core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
ForumBlockBase::getCacheTags in core/modules/forum/src/Plugin/Block/ForumBlockBase.php
SystemBrandingBlock::getCacheTags in core/modules/system/src/Plugin/Block/SystemBrandingBlock.php
SystemMenuBlock::getCacheTags in core/modules/system/src/Plugin/Block/SystemMenuBlock.php

File

core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php, line 151
Contains \Drupal\Core\Plugin\ContextAwarePluginBase.

Class

ContextAwarePluginBase
Base class for plugins that are context aware.

Namespace

Drupal\Core\Plugin

Code

public function getCacheTags() {
  $tags = [];

  // Applied contexts can affect the cache tags when this plugin is
  // involved in caching, collect and return them.
  foreach ($this
    ->getContexts() as $context) {

    /** @var $context \Drupal\Core\Cache\CacheableDependencyInterface */
    if ($context instanceof CacheableDependencyInterface) {
      $tags = Cache::mergeTags($tags, $context
        ->getCacheTags());
    }
  }
  return $tags;
}