protected function DrupalDefaultEntityController::attachLoad

cis7 entity.inc protected DrupalDefaultEntityController::attachLoad(&$queried_entities, $revision_id = FALSE)
cle7 entity.inc protected DrupalDefaultEntityController::attachLoad(&$queried_entities, $revision_id = FALSE)
elmsmedia7 entity.inc protected DrupalDefaultEntityController::attachLoad(&$queried_entities, $revision_id = FALSE)
icor7 entity.inc protected DrupalDefaultEntityController::attachLoad(&$queried_entities, $revision_id = FALSE)
meedjum_blog7 entity.inc protected DrupalDefaultEntityController::attachLoad(&$queried_entities, $revision_id = FALSE)
mooc7 entity.inc protected DrupalDefaultEntityController::attachLoad(&$queried_entities, $revision_id = FALSE)

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 NodeController::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 DrupalDefaultEntityController::attachLoad()
DrupalDefaultEntityController::load in includes/entity.inc
Implements DrupalEntityControllerInterface::load().
EntityAPIController::load in sites/all/modules/ulmus/entity/includes/entity.controller.inc
Overridden.
6 methods override DrupalDefaultEntityController::attachLoad()
CommentController::attachLoad in modules/comment/comment.module
Attaches data to entities upon loading.
EntityAPIControllerExportable::attachLoad in sites/all/modules/ulmus/entity/includes/entity.controller.inc
Overridden.
NodeController::attachLoad in modules/node/node.module
Attaches data to entities upon loading.
TestEntityBundleController::attachLoad in modules/field/tests/field_test.entity.inc
Attaches data to entities upon loading.
UserController::attachLoad in modules/user/user.module
Attaches data to entities upon loading.

... See full list

File

includes/entity.inc, line 309

Class

DrupalDefaultEntityController
Default implementation of DrupalEntityControllerInterface.

Code

protected function attachLoad(&$queried_entities, $revision_id = FALSE) {
  // Attach fields.
  if ($this->entityInfo['fieldable']) {
    if ($revision_id) {
      field_attach_load_revision($this->entityType, $queried_entities);
    }
    else {
      field_attach_load($this->entityType, $queried_entities);
    }
  }

  // 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->entityInfo['load hook']) as $module) {
    call_user_func_array($module . '_' . $this->entityInfo['load hook'], $args);
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.