Tripal Fields
Provides an application programming interface (API) for working with fields attached to TripalEntity content types (bundles).
Fields: A field is a reusable "data container" that is attached to a Bundle. Programmatically, each field provides one or more primitive data types, with validators and widgets for editing and formatters for display. Each field independently manages the data to which it assigned. Just like with Bundles, Fields are also described using controlled vocabulary terms. For example, a gene Bundle has a field attached that provides the name of the gene. This field only provides the name and nothing more. Tripal uses the schema:name vocabulary term to describe the field.
Field Instances: Fields describe "atomic" units of data that are associated with an entity. For example, a "name" is an atomic unit of data about a Gene or Organism entity. Fields can be reused for multiple Bundles. For example, gene, mRNA, genetic markers and variants all have name data. Despite that all of these Bundles provides a "name", we only need one field to describe that this data is a "name". However, we may want to customize a field specific to each bundle. Therefore, an Instance of a field is attached to a bundle, and field instances can then be customized differently. The most important customization is the one that defines the Chado table from which the data for a field is retrieved. Despite that field instances are attached to bundles, they become visible with Entities. When an entity is loaded for display, Drupal examines all of the fields that are attached to the entity's bundle, and then populates the fields instances with data specific to the entity being loaded.
Parent topics
File
- tripal/
api/ tripal.fields.api.inc, line 10 - Provides an application programming interface (API) for working with fields attached to TripalEntity content types (bundles).
Functions
Name | Location | Description |
---|---|---|
hook_bundle_fields_info |
tripal/ |
Allows a module to return a bundles field info. |
hook_bundle_instances_info |
tripal/ |
Allows a module to return the field instances of a bundle. |
hook_field_storage_tquery |
tripal/ |
Executes a TripalFieldQuery using the provided conditions. |
tripal_format_views_field_element |
tripal/ |
Formats an element of a TripalField for use by Drupal Views. |
tripal_get_field_formatters |
tripal/ |
Retrieves a list of TripalFieldFormatters. |
tripal_get_field_item_keyval |
tripal/ |
More easily get the value of a single item from a field's items array. |
tripal_get_field_types |
tripal/ |
Retrieves a list of TripalField types. |
tripal_get_field_widgets |
tripal/ |
Retrieves a list of TripalFieldWidgets. |
tripal_load_include_downloader_class |
tripal/ |
Loads the TripalEntityDownloader file into scope. |
tripal_load_include_field_class |
tripal/ |
Loads the TripalField class file into scope. |