You are here

public function EntityBase::getCacheTagsToInvalidate in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/EntityBase.php \Drupal\Core\Entity\EntityBase::getCacheTagsToInvalidate()
  2. 9 core/lib/Drupal/Core/Entity/EntityBase.php \Drupal\Core\Entity\EntityBase::getCacheTagsToInvalidate()
2 methods override EntityBase::getCacheTagsToInvalidate()
ConfigEntityBase::getCacheTagsToInvalidate in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
Returns the cache tags that should be used to invalidate caches.
PathAlias::getCacheTagsToInvalidate in core/modules/path_alias/src/Entity/PathAlias.php
Returns the cache tags that should be used to invalidate caches.

File

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

Class

EntityBase
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

public function getCacheTagsToInvalidate() {
  if ($this
    ->isNew()) {
    return [];
  }
  return [
    $this->entityTypeId . ':' . $this
      ->id(),
  ];
}