You are here

protected function ConfigEntityStorage::getFromStaticCache in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php \Drupal\Core\Config\Entity\ConfigEntityStorage::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.

Overrides EntityStorageBase::getFromStaticCache

File

core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php, line 333
Contains \Drupal\Core\Config\Entity\ConfigEntityStorage.

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;
}