You are here

public function AliasGet::getCacheTags in Services 9.0.x

Same name and namespace in other branches
  1. 8.4 src/Plugin/ServiceDefinition/AliasGet.php \Drupal\services\Plugin\ServiceDefinition\AliasGet::getCacheTags()

Overrides ContextAwarePluginTrait::getCacheTags

File

src/Plugin/ServiceDefinition/AliasGet.php, line 101

Class

AliasGet
Plugin annotation @ServiceDefinition( id = "alias_get", methods = { "GET" }, translatable = true, deriver = "\Drupal\services\Plugin\Deriver\AliasGet" )

Namespace

Drupal\services\Plugin\ServiceDefinition

Code

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

  // Applied contexts can affect the cache tags when this plugin is
  // involved in caching, collect and return them.
  if ($this->entity instanceof CacheableDependencyInterface) {
    $tags = Cache::mergeTags($tags, $this->entity
      ->getCacheTags());
  }

  /* @var $context \Drupal\Core\Cache\CacheableDependencyInterface */
  return $tags;
}