EntityStorageBase::getFromStaticCache

protected EntityStorageBase::getFromStaticCache(array $ids)

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.

File

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

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;
}
doc_Drupal
2016-10-29 09:07:40
Comments
Leave a Comment

Please login to continue.