function ContentEntityStorageBase::getFromStaticRevisionCache
Gets entity revisions from the static cache.
Parameters
int[] $revision_ids: Revision IDs to return from the static revision cache.
Return value
\Drupal\Core\Entity\ContentEntityInterface[] An array of revisions from the cache.
1 call to ContentEntityStorageBase::getFromStaticRevisionCache()
- ContentEntityStorageBase::loadMultipleRevisions in core/
lib/ Drupal/ Core/ Entity/ ContentEntityStorageBase.php - Loads multiple entity revisions.
File
-
core/
lib/ Drupal/ Core/ Entity/ ContentEntityStorageBase.php, line 1349
Class
- ContentEntityStorageBase
- Base class for content entity storage handlers.
Namespace
Drupal\Core\EntityCode
protected function getFromStaticRevisionCache(array $revision_ids) : array {
$revisions = [];
// Load any available entities from the internal revision cache.
if ($this->entityType
->isStaticallyCacheable()) {
$cache_ids = array_map(function ($revision_id) {
return $this->buildRevisionCacheId($revision_id);
}, $revision_ids);
$map = array_combine($cache_ids, $revision_ids);
$cache_items = $this->memoryCache
->getMultiple($cache_ids);
foreach ($cache_items as $cache_id => $item) {
$revisions[$map[$cache_id]] = $item->data;
}
}
return $revisions;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.