The new field functionality is an extremely important change in Drupal 7 and the API was heavily modified to support this new functionality. Unfortunately, there is no space in this book to look at each new method in detail due to the sheer number of new hooks and methods within the Field API. Instead, let's look at the major concepts and subsections within the Field API. For a complete reference on the methods defined within the Field API, see: http://api.drupal.org/api/group/field/7.
Entities represent objects within Drupal that fields can be attached to. Entities must have a controller for them that is a class implementing the DrupalEntityController
interface. The controller is responsible for loading entities and handling operations for the entity. Common built-in entities include nodes and users. Additional information about an entity can be defined using hook_entity_info
and hook_entity_info_alter
. You can react to entities being loaded using hook_entity_load
.