protected function ContentEntityStorageBase::setPersistentCache in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php \Drupal\Core\Entity\ContentEntityStorageBase::setPersistentCache()
- 9 core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php \Drupal\Core\Entity\ContentEntityStorageBase::setPersistentCache()
Stores entities in the persistent cache backend.
Parameters
\Drupal\Core\Entity\ContentEntityInterface[] $entities: Entities to store in the cache.
1 call to ContentEntityStorageBase::setPersistentCache()
- SqlContentEntityStorage::doLoadMultiple in core/
lib/ Drupal/ Core/ Entity/ Sql/ SqlContentEntityStorage.php - Performs storage-specific loading of entities.
File
- core/
lib/ Drupal/ Core/ Entity/ ContentEntityStorageBase.php, line 1107
Class
- ContentEntityStorageBase
- Base class for content entity storage handlers.
Namespace
Drupal\Core\EntityCode
protected function setPersistentCache($entities) {
if (!$this->entityType
->isPersistentlyCacheable()) {
return;
}
$cache_tags = [
$this->entityTypeId . '_values',
'entity_field_info',
];
foreach ($entities as $id => $entity) {
$this->cacheBackend
->set($this
->buildCacheId($id), $entity, CacheBackendInterface::CACHE_PERMANENT, $cache_tags);
}
}