Operate on Field API data attached to Drupal objects.
Field Attach API functions load, store, generate Form API structures, display, and perform a vareity of other functions for field data connected to individual objects.
Field Attach API functions generally take $obj_type and $object arguments along with additional function-specific arguments. $obj_type is the type of the fieldable entity, such as 'node' or 'user', and $object is the object itself. An individual object's bundle, if any, is read from the object's bundle key property identified by hook_fieldable_info() for $obj_type.
Fieldable types call Field Attach API functions during their own API calls; for example, node_load() calls field_attach_load(). A fieldable type is not required to use all of the Field Attach API functions.
Most Field Attach API functions define a corresponding hook function that allows any module to act on Field Attach operations for any object after the operation is complete, and access or modify all the field, form, or display data for that object and operation. For example, field_attach_view() invokes hook_field_attach_view_alter(). These all-module hooks are distinct from those of the Field Types API, such as hook_field_load(), that are only invoked for the module that defines a specific field type.
field_attach_load(), field_attach_insert(), and field_attach_update() also define pre-operation hooks, e.g. hook_field_attach_pre_load(). These hooks run before the corresponding Field Storage API and Field Type API operations. They allow modules to define additional storage locations (e.g. denormalizing, mirroring) for field data on a per-field basis. They also allow modules to take over field storage completely by instructing other implementations of the same hook and the Field Storage API itself not to operate on specified fields.
The pre-operation hooks do not make the Field Storage API irrelevant. The Field Storage API is essentially the "fallback mechanism" for any fields that aren't being intercepted explicitly by pre-operation hooks.
| Name | Beschreibung |
|---|---|
| field_attach_create_bundle | Notify field.module that a new bundle was created. |
| field_attach_delete | Delete field data for an existing object. This deletes all revisions of field data for the object. |
| field_attach_delete_bundle | Notify field.module the a bundle was deleted. |
| field_attach_delete_revision | Delete field data for a single revision of an existing object. The passed object must have a revision id attribute. |
| field_attach_extract_ids | Helper function to extract id, vid, and bundle name from an object. |
| field_attach_form | Add form elements for all fields for an object to a form structure. |
| field_attach_form_validate | Perform field validation against form-submitted field values. |
| field_attach_insert | Save field data for a new object. |
| field_attach_load | Load all fields for the most current version of each of a set of objects of a single object type. |
| field_attach_load_revision | Load all fields for a previous version of each of a set of objects of a single object type. |
| field_attach_prepare_translation | Implementation of hook_node_prepare_translation. |
| field_attach_preprocess | To be called in entity preprocessor. |
| field_attach_presave | Perform necessary operations just before fields data get saved. |
| field_attach_rename_bundle | Notify field.module that a bundle was renamed. |
| field_attach_submit | Perform necessary operations on field data submitted by a form. |
| field_attach_update | Save field data for an existing object. |
| field_attach_validate | Perform field validation against the field data in an object. |
| field_attach_view | Generate and return a structured content array tree suitable for drupal_render() for all of the fields on an object. The format of each field's rendered content depends on the display formatter and its settings. |
| hook_field_attach_create_bundle | Act on field_attach_create_bundle. |
| hook_field_attach_delete | Act on field_attach_delete. |
| hook_field_attach_delete_bundle | Act on field_attach_delete_bundle. |
| hook_field_attach_delete_revision | Act on field_attach_delete_revision. |
| hook_field_attach_form | Act on field_attach_form. |
| hook_field_attach_load | Act on field_attach_load. |
| hook_field_attach_presave | Act on field_attach_presave. |
| hook_field_attach_pre_insert | Act on field_attach_insert. |
| hook_field_attach_pre_load | Act on field_attach_pre_load. |
| hook_field_attach_pre_update | Act on field_attach_update. |
| hook_field_attach_submit | Act on field_attach_submit. |
| hook_field_attach_validate | Act on field_attach_validate. |
| hook_field_attach_view_alter | Act on field_attach_view. |
| hook_field_rename_bundle | Act on field_attach_rename_bundle. |
| _field_invoke | Invoke a field hook. |
| _field_invoke_default | Invoke field.module's version of a field hook. |
| _field_invoke_multiple | Invoke a field operation across fields on multiple objects. |
| _field_invoke_multiple_default | Invoke field.module's version of a field hook on multiple objects. |
modules/
Kommentare
Kommentar hinzufügen