ConfigEntityStorage::getFromStaticCache

protected ConfigEntityStorage::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.

Overrides EntityStorageBase::getFromStaticCache

File

core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php, line 328

Class

ConfigEntityStorage
Defines the storage class for configuration entities.

Namespace

Drupal\Core\Config\Entity

Code

protected function getFromStaticCache(array $ids) {
  $entities = array();
  // Load any available entities from the internal cache.
  if ($this->entityType->isStaticallyCacheable() && !empty($this->entities)) {
    $config_overrides_key = $this->overrideFree ? '' : implode(':', $this->configFactory->getCacheKeys());
    foreach ($ids as $id) {
      if (!empty($this->entities[$id])) {
        if (isset($this->entities[$id][$config_overrides_key])) {
          $entities[$id] = $this->entities[$id][$config_overrides_key];
        }
      }
    }
  }
  return $entities;
}
doc_Drupal
2016-10-29 08:52:54
Comments
Leave a Comment

Please login to continue.