function EntityStorageBase::setNotFoundStaticCache

Same name and namespace in other branches
  1. main core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::setNotFoundStaticCache()

Stores not found entities in the static entity cache.

Parameters

array $remaining_ids: Not found entity IDs to store in the cache.

File

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

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\Entity

Code

protected function setNotFoundStaticCache(array $remaining_ids) : void {
  if ($this->entityType
    ->isStaticallyCacheable()) {
    foreach ($remaining_ids as $id) {
      $this->memoryCache
        ->set($this->buildNotFoundCacheId($id), FALSE, MemoryCacheInterface::CACHE_PERMANENT, [
        $this->memoryCacheTag,
      ]);
    }
  }
}

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