function ContentEntityStorageBase::resetRevisionCache

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php \Drupal\Core\Entity\ContentEntityStorageBase::resetRevisionCache()

Resets the static and persistent revision caches.

Parameters

int[] $revision_ids: The entity revision IDs to reset the static and persistent revision caches for.

File

core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php, line 1488

Class

ContentEntityStorageBase
Base class for content entity storage handlers.

Namespace

Drupal\Core\Entity

Code

protected function resetRevisionCache(array $revision_ids) : void {
  $cache_ids = array_map(function ($revision_id) {
    return $this->buildRevisionCacheId($revision_id);
  }, $revision_ids);
  if ($this->entityType
    ->isStaticallyCacheable()) {
    $this->memoryCache
      ->deleteMultiple($cache_ids);
  }
  if ($this->entityType
    ->isPersistentlyCacheable()) {
    $this->cacheBackend
      ->deleteMultiple($cache_ids);
  }
}

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