You are here

protected function EntityStorageBase::getFromStaticCache in Zircon Profile 8

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

Gets entities from the static cache.

Parameters

array $ids: If not empty, return entities that match these IDs.

Return value

\Drupal\Core\Entity\EntityInterface[] Array of entities from the entity cache.

1 call to EntityStorageBase::getFromStaticCache()
EntityStorageBase::loadMultiple in core/lib/Drupal/Core/Entity/EntityStorageBase.php
Loads one or more entities.
1 method overrides EntityStorageBase::getFromStaticCache()
ConfigEntityStorage::getFromStaticCache in core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php
Gets entities from the static cache.

File

core/lib/Drupal/Core/Entity/EntityStorageBase.php, line 140
Contains \Drupal\Core\Entity\EntityStorageBase.

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\Entity

Code

protected function getFromStaticCache(array $ids) {
  $entities = array();

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