public function ConfigStorageController::load

Implements Drupal\Core\Entity\EntityStorageControllerInterface::load().

Overrides EntityStorageControllerInterface::load

6 calls to ConfigStorageController::load()
BlockStorageController::load in drupal/core/modules/block/lib/Drupal/block/BlockStorageController.php
Implements Drupal\Core\Entity\EntityStorageControllerInterface::load().
ConfigStorageController::importDelete in drupal/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
Delete configuration upon synchronizing configuration changes.
ConfigStorageController::importUpdate in drupal/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
Updates configuration upon synchronizing configuration changes.
ConfigStorageController::loadByProperties in drupal/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
Implements Drupal\Core\Entity\EntityStorageControllerInterface::loadByProperties().
ConfigStorageController::save in drupal/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
Implements Drupal\Core\Entity\EntityStorageControllerInterface::save().

... See full list

2 methods override ConfigStorageController::load()
BlockStorageController::load in drupal/core/modules/block/lib/Drupal/block/BlockStorageController.php
Implements Drupal\Core\Entity\EntityStorageControllerInterface::load().
ViewStorageController::load in drupal/core/modules/views/lib/Drupal/views/ViewStorageController.php
Overrides Drupal\config\ConfigStorageController::load();

File

drupal/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php, line 107
Definition of Drupal\Core\Config\Entity\ConfigStorageController.

Class

ConfigStorageController
Defines the storage controller class for configuration entities.

Namespace

Drupal\Core\Config\Entity

Code

public function load(array $ids = NULL) {
  $entities = array();

  // Create a new variable which is either a prepared version of the $ids
  // array for later comparison with the entity cache, or FALSE if no $ids
  // were passed.
  $passed_ids = !empty($ids) ? array_flip($ids) : FALSE;

  // Load any remaining entities. This is the case if $ids is set to NULL (so
  // we load all entities).
  if ($ids === NULL || $ids) {
    $queried_entities = $this
      ->buildQuery($ids);
  }

  // Pass all entities loaded from the database through $this->attachLoad(),
  // which calls the
  // entity type specific load callback, for example hook_node_type_load().
  if (!empty($queried_entities)) {
    $this
      ->attachLoad($queried_entities);
    $entities += $queried_entities;
  }

  // Ensure that the returned array is ordered the same as the original
  // $ids array if this was passed in and remove any invalid ids.
  if ($passed_ids) {

    // Remove any invalid ids from the array.
    $passed_ids = array_intersect_key($passed_ids, $entities);
    foreach ($entities as $entity) {
      $passed_ids[$entity->{$this->idKey}] = $entity;
    }
    $entities = $passed_ids;
  }
  return $entities;
}