Tripal
All Classes Files Functions Variables Modules Pages
Functions
tripal.fields.api.inc File Reference

Functions

 hook_field_storage_tquery ($conditions, $orderBy)
 
 hook_bundle_fields_info ($entity_type, $bundle)
 
 hook_bundle_fields_info_alter (&$info, $bundle, $term)
 
 hook_bundle_instances_info ($entity_type, $bundle)
 
 hook_bundle_instances_info_alter (&$info, $bundle, $term)
 
 tripal_field_is_empty ($field, $items, $delta=0)
 
 tripal_get_tripalfield_files ()
 
 tripal_get_field_types ()
 
 tripal_get_field_widgets ()
 
 tripal_get_field_field_formatters ($field, $instance)
 
 tripal_get_field_formatters ()
 
 tripal_load_include_field_class ($class)
 
 tripal_load_include_downloader_class ($class)
 
 tripal_get_field_item_keyval ($items, $delta, $key, $default='')
 
 tripal_format_views_field_element ($field_name, $term)
 

Detailed Description

Provides an application programming interface (API) for working with fields attached to TripalEntity content types (bundles).

Function Documentation

◆ hook_bundle_fields_info_alter()

hook_bundle_fields_info_alter ( $info,
  $bundle,
  $term 
)

Allows a module to adjust a field's info settings.

Modules should only adjust the info array for fields that they manage and not fields that were created by other modules. For example, if a field corresponds to a column in a custom table of Chado, then the tripal_chado module will automatically create a field for it. This function can be used to override the default settings created by Chado.

Parameters
$infoThe fields info array for all fields.
$bundleThe bundle content type object that the field belongs to.
$termThe bundle type term.

◆ hook_bundle_instances_info_alter()

hook_bundle_instances_info_alter ( $info,
  $bundle,
  $term 
)

Allows a module to adjust field instances info settings.

Modules should only adjust the info array for field instances that they manage and not fields that were created by other modules. For example, if a field corresponds to a column in a custom table of Chado, then the tripal_chado module will automatically create a field for it. This function can be used to override the default settings created by Chado.

Parameters
$infoThe field instance info array for all fields.
$bundleThe bundle content type object that the field belongs to.
$termThe bundle type term.

◆ tripal_get_field_field_formatters()

tripal_get_field_field_formatters (   $field,
  $instance 
)

Retrieves a list of field formatters compatible with a given field.

Parameters
$fieldA field array as returned by the field_info_field() function.
$instanceA field instance array.
Returns
A list of file formatter class names.

◆ tripal_get_tripalfield_files()

tripal_get_tripalfield_files ( )

Retrieves a list of all fields implementing Tripal Fields/Formatters/Widgets.

The TripalField classes can be added by the site developer and should be placed in the [module]/includes/TripalFields directory. Tripal will support any field as long as:

  • it's in the [modules]/includes/TripalFields directory,
  • extends TripalField, TripalWidget or TripalFormatter,
  • matches the [cvname]__[termname] convention.
Returns
An array of files containing Tripal fields, widgets or formatters where each element has a name, filename, and uri. The URI is relative to your drupal root.