You are here

protected function EntityBase::getListCacheTagsToInvalidate in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityBase.php \Drupal\Core\Entity\EntityBase::getListCacheTagsToInvalidate()

The list cache tags to invalidate for this entity.

Return value

string[] Set of list cache tags.

2 calls to EntityBase::getListCacheTagsToInvalidate()
ConfigEntityBase::invalidateTagsOnSave in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
Override to never invalidate the entity's cache tag; the config system already invalidates it.
EntityBase::invalidateTagsOnSave in core/lib/Drupal/Core/Entity/EntityBase.php
Invalidates an entity's cache tags upon save.

File

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

Class

EntityBase
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

protected function getListCacheTagsToInvalidate() {
  $tags = $this
    ->getEntityType()
    ->getListCacheTags();
  if ($this
    ->getEntityType()
    ->hasKey('bundle')) {
    $tags[] = $this
      ->getEntityTypeId() . '_list:' . $this
      ->bundle();
  }
  return $tags;
}