Field CRUD API

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.

See Field API for information about the other parts of the Field API.

Functions & methods

NameLocationDescription
field_create_fieldmodules/field/field.crud.incCreates a field.
field_create_instancemodules/field/field.crud.incCreates an instance of a field, binding it to a bundle.
field_delete_fieldmodules/field/field.crud.incMarks a field and its instances and data for deletion.
field_delete_instancemodules/field/field.crud.incMarks a field instance and its data for deletion.
field_read_fieldmodules/field/field.crud.incReads a single field record directly from the database.
field_read_fieldsmodules/field/field.crud.incReads in fields that match an array of conditions.
field_read_instancemodules/field/field.crud.incReads a single instance record from the database.
field_read_instancesmodules/field/field.crud.incReads in field instances that match an array of conditions.
field_update_fieldmodules/field/field.crud.incUpdates a field.
field_update_instancemodules/field/field.crud.incUpdates an instance of a field.
hook_field_create_fieldmodules/field/field.api.phpAct on a field being created.
hook_field_create_instancemodules/field/field.api.phpAct on a field instance being created.
hook_field_delete_fieldmodules/field/field.api.phpAct on a field being deleted.
hook_field_delete_instancemodules/field/field.api.phpAct on a field instance being deleted.
hook_field_purge_fieldmodules/field/field.api.phpActs when a field record is being purged.
hook_field_purge_instancemodules/field/field.api.phpActs when a field instance is being purged.
hook_field_read_fieldmodules/field/field.api.phpAct on field records being read from the database.
hook_field_read_instancemodules/field/field.api.phpAct on a field record being read from the database.
hook_field_storage_purgemodules/field/field.api.phpRemove field storage information when field data is purged.
hook_field_storage_purge_fieldmodules/field/field.api.phpRemove field storage information when a field record is purged.
hook_field_storage_purge_field_instancemodules/field/field.api.phpRemove field storage information when a field instance is purged.
hook_field_update_fieldmodules/field/field.api.phpAct on a field being updated.
hook_field_update_forbidmodules/field/field.api.phpForbid a field update from occurring.
hook_field_update_instancemodules/field/field.api.phpAct on a field instance being updated.
_field_write_instancemodules/field/field.crud.incStores an instance record in the field configuration database.

File

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