1 field_test.controller.inc | protected TestEntityBundleController::attachLoad(&$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 no revision was specified..
Overrides DefaultEntityController::attachLoad
File
- core/
modules/ field/ tests/ field_test/ field_test.controller.inc, line 10
Class
- TestEntityBundleController
- Controller class for the test_entity_bundle entity type.
Code
protected function attachLoad(&$entities, $revision_id = FALSE) {
// Add bundle information.
foreach ($entities as $key => $entity) {
$entity->fttype = 'test_entity_bundle';
$entities[$key] = $entity;
}
parent::attachLoad($entities, $revision_id);
}