| Versionen | |
|---|---|
| drupal7 | hook_field_load($obj_type, $objects, $field, $instances, &$items, $age) |
Define custom load behavior for this module's field types.
Unlike other field hooks, this hook operates on multiple objects. The $objects, $instances and $items parameters are arrays keyed by object id. For performance reasons, information for all available objects should be loaded in a single query where possible.
Note that the changes made to the field values get cached by the field cache for subsequent loads.
$obj_type The type of $object.
$objects Array of objects being loaded, keyed by object id.
$field The field structure for the operation.
$instances Array of instance structures for $field for each object, keyed by object id.
$items Array of field values already loaded for the objects, keyed by object id.
$age FIELD_LOAD_CURRENT to load the most recent revision for all fields, or FIELD_LOAD_REVISION to load the version indicated by each object.
Changes or additions to field values are done by altering the $items parameter by reference.
modules/
<?php
function hook_field_load($obj_type, $objects, $field, $instances, &$items, $age) { }
?>
Kommentare
Kommentar hinzufügen