W3cubDocs

/Drupal 8

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!Entity!ConfigEntityStorage.php/function/ConfigEntityStorage::getFromStaticCache/8.1.x