You are here

public function AliasGet::getCacheTags in Services 8.4

Same name and namespace in other branches
  1. 9.0.x src/Plugin/ServiceDefinition/AliasGet.php \Drupal\services\Plugin\ServiceDefinition\AliasGet::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/ServiceDefinition/AliasGet.php, line 102

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 \Drupal\Core\Cache\CacheableDependencyInterface $context */
  return $tags;
}