hook_field_load

  1. drupal
    1. drupal7
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.

Übergabeparameter

$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.

Rückgabewert

Changes or additions to field values are done by altering the $items parameter by reference.

Verwandte Themen

Code

modules/field/field.api.php, line 231

<?php
function hook_field_load($obj_type, $objects, $field, $instances, &$items, $age) { }
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen