function entity_load

cis7 common.inc entity_load($entity_type, $ids = FALSE, $conditions = array(), $reset = FALSE)
cle7 common.inc entity_load($entity_type, $ids = FALSE, $conditions = array(), $reset = FALSE)
elmsmedia7 common.inc entity_load($entity_type, $ids = FALSE, $conditions = array(), $reset = FALSE)
icor7 common.inc entity_load($entity_type, $ids = FALSE, $conditions = array(), $reset = FALSE)
meedjum_blog7 common.inc entity_load($entity_type, $ids = FALSE, $conditions = array(), $reset = FALSE)
mooc7 common.inc entity_load($entity_type, $ids = FALSE, $conditions = array(), $reset = FALSE)

Load entities from the database.

The entities are stored in a static memory cache, 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 DrupalEntityControllerInterface 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 DrupalEntityControllerInterface interface, or, most commonly, extend the DrupalDefaultEntityController class. See node_entity_info() and the NodeController in node.module as an example.

@todo Remove $conditions in Drupal 8.

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: (deprecated) An associative array of conditions on the base table, where the keys are the database fields and the values are the values those fields must have. Instead, it is preferable to use EntityFieldQuery to retrieve a list of entity IDs loadable by this function.

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

Return value

An array of entity objects indexed by their ids. When no results are found, an empty array is returned.

See also

hook_entity_info()

DrupalEntityControllerInterface

DrupalDefaultEntityController

EntityFieldQuery

98 calls to entity_load()
accessibility_test_load_multiple in sites/all/modules/ulmus/accessibility/accessibility.module
Loads multiple accessibility test entities.
cis_example_cis_form_alter in sites/all/modules/_my_modules/cis_examples/cis_example_cis/cis_example_cis.module
Implements hook_form_alter().
cis_example_cis_service_set_cis_service_data in sites/all/modules/_my_modules/cis_examples/cis_example_cis_service/cis_example_cis_service.module
Implements hook_set_cis_service_data().
cis_section_all_sections in sites/all/modules/elmsln_contrib/cis_connector/features/cis_section/cis_section.module
Return all found sections as these are valid for switching
cis_service_connection_load_group in sites/all/modules/elmsln_contrib/cis_connector/modules/cis_service_connection/cis_service_connection.module
Return a group node when passed a section string.

... See full list

2 string references to 'entity_load'
DrupalDefaultEntityController::attachLoad in includes/entity.inc
Attaches data to entities upon loading.
EntityAPIControllerExportable::attachLoad in sites/all/modules/ulmus/entity/includes/entity.controller.inc
Overridden.

File

includes/common.inc, line 7800
Common functions that many Drupal modules will need to reference.

Code

function entity_load($entity_type, $ids = FALSE, $conditions = array(), $reset = FALSE) {
  if ($reset) {
    entity_get_controller($entity_type)->resetCache();
  }
  return entity_get_controller($entity_type)->load($ids, $conditions);
}
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.