function EntityStorageBase::resetCache

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::resetCache()
  2. 10 core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::resetCache()
  3. 11.x core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::resetCache()

Overrides EntityStorageInterface::resetCache

6 calls to EntityStorageBase::resetCache()
ContentEntityStorageBase::loadUnchanged in core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
Loads an unchanged entity from the database.
ContentEntityStorageBase::resetCache in core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
Resets the internal, static entity cache.
EntityStorageBase::delete in core/lib/Drupal/Core/Entity/EntityStorageBase.php
Deletes permanently saved entities.
EntityStorageBase::doPostSave in core/lib/Drupal/Core/Entity/EntityStorageBase.php
Performs post save entity processing.
EntityStorageBase::loadUnchanged in core/lib/Drupal/Core/Entity/EntityStorageBase.php
Loads an unchanged entity from the database.

... See full list

2 methods override EntityStorageBase::resetCache()
ContentEntityStorageBase::resetCache in core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
Resets the internal, static entity cache.
VocabularyStorage::resetCache in core/modules/taxonomy/src/VocabularyStorage.php
Resets the internal, static entity cache.

File

core/lib/Drupal/Core/Entity/EntityStorageBase.php, line 145

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\Entity

Code

public function resetCache(array $ids = NULL) {
    if ($this->entityType
        ->isStaticallyCacheable() && isset($ids)) {
        foreach ($ids as $id) {
            $this->memoryCache
                ->delete($this->buildCacheId($id));
        }
    }
    else {
        // Call the backend method directly.
        $this->memoryCache
            ->invalidateTags([
            $this->memoryCacheTag,
        ]);
    }
}

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