protected function ConfigStorageController::attachLoad

Attaches data to entities upon loading.

This will attach fields, if the entity is fieldable. It calls hook_entity_load() for modules which need to add data to all entities. It also calls hook_TYPE_load() on the loaded entities. For example hook_node_load() or hook_user_load(). If your hook_TYPE_load() expects special parameters apart from the queried entities, you can set $this->hookLoadArguments prior to calling the method. See Drupal\node\NodeStorageController::attachLoad() for an example.

Parameters

$queried_entities: Associative array of query results, keyed on the entity ID.

$revision_id: ID of the revision that was loaded, or FALSE if the most current revision was loaded.

2 calls to ConfigStorageController::attachLoad()
ConfigStorageController::load in drupal/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
Implements Drupal\Core\Entity\EntityStorageControllerInterface::load().
ViewStorageController::attachLoad in drupal/core/modules/views/lib/Drupal/views/ViewStorageController.php
Overrides Drupal\config\ConfigStorageController::attachLoad();
1 method overrides ConfigStorageController::attachLoad()
ViewStorageController::attachLoad in drupal/core/modules/views/lib/Drupal/views/ViewStorageController.php
Overrides Drupal\config\ConfigStorageController::attachLoad();

File

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

Class

ConfigStorageController
Defines the storage controller class for configuration entities.

Namespace

Drupal\Core\Config\Entity

Code

protected function attachLoad(&$queried_entities, $revision_id = FALSE) {

  // Call hook_entity_load().
  foreach (module_implements('entity_load') as $module) {
    $function = $module . '_entity_load';
    $function($queried_entities, $this->entityType);
  }

  // Call hook_TYPE_load(). The first argument for hook_TYPE_load() are
  // always the queried entities, followed by additional arguments set in
  // $this->hookLoadArguments.
  $args = array_merge(array(
    $queried_entities,
  ), $this->hookLoadArguments);
  foreach (module_implements($this->entityType . '_load') as $module) {
    call_user_func_array($module . '_' . $this->entityType . '_load', $args);
  }
}