You are here

protected function ContentEntityStorageTrait::getFromStaticCache in Multiversion 8

File

src/Entity/Storage/ContentEntityStorageTrait.php, line 538

Class

ContentEntityStorageTrait

Namespace

Drupal\multiversion\Entity\Storage

Code

protected function getFromStaticCache(array $ids) {
  if (version_compare(\Drupal::VERSION, '8.7', '>')) {
    $entities = parent::getFromStaticCache($ids);
  }
  else {
    $ws = $this
      ->getWorkspaceId();
    $entities = [];

    // Load any available entities from the internal cache.
    if ($this->entityType
      ->isStaticallyCacheable() && !empty($this->entities[$ws])) {
      $entities += array_intersect_key($this->entities[$ws], array_flip($ids));
    }
  }
  return $entities;
}