entity_load

Versions
mediamosa-21
entity_load($entity_type, $ids = array(), $conditions = array(), $reset = FALSE)

Load entities from the database.

This function should be used whenever you need to load more than one entity from the database. The entities are loaded into memory and will not require database access if loaded again during the same page request.

The actual loading is done through a class that has to implement the DrupalEntityController interface. By default, DrupalDefaultEntityController is used. Entity types can specify that a different class should be used by setting the 'controller class' key in hook_entity_info(). These classes can either implement the DrupalEntityController interface, or, most commonly, extend the DrupalDefaultEntityController class. See node_entity_info() and the NodeController in node.module as an example.

See also

hook_entity_info()

@see DrupalEntityController

See also

DrupalDefaultEntityController

Parameters

$entity_type The entity type to load, e.g. node or user.

$ids An array of entity IDs, or FALSE to load all entities.

$conditions An array of conditions in the form 'field' => $value.

$reset Whether to reset the internal cache for the requested entity type.

Return value

An array of entity objects indexed by their ids.

▾ 6 functions call entity_load()

comment_load_multiple in modules/comment/comment.module
Load comments from the database.
file_load_multiple in includes/file.inc
Load file objects from the database.
node_load_multiple in modules/node/node.module
Load node entities from the database.
taxonomy_term_load_multiple in modules/taxonomy/taxonomy.module
Load multiple taxonomy terms based on certain conditions.
taxonomy_vocabulary_load_multiple in modules/taxonomy/taxonomy.module
Load multiple taxonomy vocabularies based on certain conditions.
user_load_multiple in modules/user/user.module
Load multiple users based on certain conditions.

Code

includes/common.inc, line 6382

<?php
function entity_load($entity_type, $ids = array(), $conditions = array(), $reset = FALSE) {
  if ($reset) {
    entity_get_controller($entity_type)->resetCache();
  }
  return entity_get_controller($entity_type)->load($ids, $conditions);
}
?>