function EntityBase::getListCacheTagsToInvalidate

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

3 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::invalidateTagsOnSave in core/modules/file/src/Entity/File.php
Invalidates an entity's cache tags upon save.

File

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

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.