You are here

public function EntityBase::getCacheTags in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityBase.php \Drupal\Core\Entity\EntityBase::getCacheTags()
  2. 10 core/lib/Drupal/Core/Entity/EntityBase.php \Drupal\Core\Entity\EntityBase::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 CacheableDependencyTrait::getCacheTags

1 call to EntityBase::getCacheTags()
View::invalidateCaches in core/modules/views/src/Entity/View.php
Invalidates cache tags.

File

core/lib/Drupal/Core/Entity/EntityBase.php, line 523

Class

EntityBase
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

public function getCacheTags() {
  if ($this->cacheTags) {
    return Cache::mergeTags($this
      ->getCacheTagsToInvalidate(), $this->cacheTags);
  }
  return $this
    ->getCacheTagsToInvalidate();
}