Skip navigation
Help

Field CRUD API

  1. drupal
    1. 7 drupal/modules/field/field.crud.inc

Create, update, and delete Field API fields, bundles, and instances.

Modules use this API, often in hook_install(), to create custom data structures. UI modules will use it to create a user interface.

The Field CRUD API uses Field API data structures.

Functions & methods

NameDescription
field_create_fieldCreates a field.
field_create_instanceCreates an instance of a field, binding it to a bundle.
field_delete_fieldMarks a field and its instances and data for deletion.
field_delete_instanceMarks a field instance and its data for deletion.
field_read_fieldReads a single field record directly from the database.
field_read_fieldsReads in fields that match an array of conditions.
field_read_instanceReads a single instance record from the database.
field_read_instancesReads in field instances that match an array of conditions.
field_update_fieldUpdates a field.
field_update_instanceUpdates an instance of a field.
hook_field_create_fieldAct on a field being created.
hook_field_create_instanceAct on a field instance being created.
hook_field_delete_fieldAct on a field being deleted.
hook_field_delete_instanceAct on a field instance being deleted.
hook_field_purge_fieldActs when a field record is being purged.
hook_field_purge_field_instanceActs when a field instance is being purged.
hook_field_read_fieldAct on field records being read from the database.
hook_field_read_instanceAct on a field record being read from the database.
hook_field_storage_purgeRemove field storage information when field data is purged.
hook_field_storage_purge_fieldRemove field storage information when a field record is purged.
hook_field_storage_purge_field_instanceRemove field storage information when a field instance is purged.
hook_field_update_fieldAct on a field being updated.
hook_field_update_forbidForbid a field update from occurring.
hook_field_update_instanceAct on a field instance being updated.
_field_write_instanceStores an instance record in the field configuration database.

File

drupal/modules/field/field.crud.inc, line 8
Field CRUD API, handling field and field instance creation and deletion.