Tripal
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
ChadoField Class Reference
Inheritance diagram for ChadoField:
Inheritance graph
[legend]
Collaboration diagram for ChadoField:
Collaboration graph
[legend]

Public Member Functions

 query ($query, $condition)
 
 queryOrder ($query, $order)
 
 getValueList ($options=[], $keyword=NULL)
 
 instanceSettingsForm ()
 
- Public Member Functions inherited from TripalField
 __construct ($field, $instance)
 
 getFieldName ()
 
 getField ()
 
 getInstance ()
 
 getFieldTerm ()
 
 getFieldTermID ()
 
 webServicesData ()
 
 viewsData ($view_base_id)
 
 validate ($entity_type, $entity, $langcode, $items, &$errors)
 
 load ($entity)
 
 elementInfo ()
 
 settingsForm ($has_data)
 
 settingsFormValidate ($form, &$form_state)
 
 settingsTheme ($element)
 
 instanceSettingsFormValidate ($form, &$form_state)
 
 createInstance ()
 

Static Public Attributes

static $default_label = 'Chado Field'
 
static $default_description = 'The generic base class for all Chado fields. Replace this text as appropriate for the child implementation.'
 
static $default_settings
 
static $default_instance_settings
 
static $download_formatters
 
static $module = 'tripal_chado'
 
- Static Public Attributes inherited from TripalField
static $default_label = 'Tripal Field'
 
static $default_description = 'The generic base class for all Tripal fields. Replace this text as appropriate for the child implementation.'
 
static $default_settings
 
static $default_instance_settings
 
static $download_formatters
 
static $default_widget = ''
 
static $default_formatter = ''
 
static $module = 'tripal'
 
static $no_ui = TRUE
 
static $no_data = FALSE
 

Protected Member Functions

 queryJoinOnce ($query, $table, $alias, $condition, $type='INNER')
 
- Protected Member Functions inherited from TripalField
 _addWebServiceElement (&$searchable_keys, &$sortable_keys, $parent_term_name, $parent_term, $element_name, $element_details)
 
 _addViewsDataElement (&$data, $view_base_id, $parent, $element_name, $element_details)
 

Additional Inherited Members

- Static Public Member Functions inherited from TripalField
static info ()
 
- Protected Attributes inherited from TripalField
 $field
 
 $instance
 
 $term
 

Member Function Documentation

◆ getValueList()

ChadoField::getValueList (   $options = [],
  $keyword = NULL 
)

Used to retrieve a distinct list of values already used for the current field instance.

Parameters
$keywordA string option used to filter the distinct list. This is used when creating an autocomplete. For all distinct values, set this to NULL.
$optionsAn array where options for how to generate this list can be specified. Supported options include:
  • limit: how many results to limit to (Default: 25)
  • label_string: a string with tokens that should be used to generate the human-readable values in the returned list.

The following example shows you how to pull all the value list for a specific instance of a field.

// In this example we want the values for the obi__organism field
// attached to the Tripal Content Type with a machine name of bio_data_17:
$field_name = 'obi__organism';
$bundle_name = 'bio_data_17';
// The following two calls get information about the field we want the
values for.
$field_info = field_info_field($field_name);
$instance_info = field_info_instance('TripalEntity', $field_name,
$bundle_name);
// Construct the Field instance we want the values for.
$instance = new ChadoField($field_info, $instance_info);
// Retrieve the values.
// $values will be an array containing the distinct set of values for this
field instance.
$values = $instance->getValueList();
Definition: ChadoField.inc:3
Returns
An array of values.

Reimplemented from TripalField.

◆ instanceSettingsForm()

ChadoField::instanceSettingsForm ( )

◆ query()

ChadoField::query (   $query,
  $condition 
)
See also
TripalField::query()

In addition to the rules to follow for the TripalField::query function these should also be followed for the ChadoField::query implementation.

  • When giving alias to joined tables be sure to use aliases that are unique to avoid conflicts with other fields.
  • When joining with the base table its alias is 'base'.
  • You may join to materialized views if need be to help speed queries.

Reimplemented from TripalField.

Reimplemented in uo__unit, taxrank__infraspecific_taxon, sio__vocabulary, sio__annotation, sep__protocol, schema__alternate_name, schema__additional_type, sbo__relationship, sbo__database_cross_reference, operation__analysis, ogi__location_on_map, obi__organism, local__source_data, local__contact, efo__array_design, data__sequence_coordinates, data__accession, chado_linker__prop, and chado_linker__contact.

◆ queryJoinOnce()

ChadoField::queryJoinOnce (   $query,
  $table,
  $alias,
  $condition,
  $type = 'INNER' 
)
protected

A convient way to join a table to a query without duplicates.

Parameters
$queryThe SelectQuery object.
$tableThe table to join.
$aliasThe table alias to use.
$conditionThe join condition.
$typeThe type of join: INNER, LEFT OUTER, or RIGHT OUTER.

◆ queryOrder()

ChadoField::queryOrder (   $query,
  $order 
)

Member Data Documentation

◆ $default_instance_settings

ChadoField::$default_instance_settings
static
Initial value:
= [
'term_vocabulary' => 'schema',
'term_name' => 'Thing',
'term_accession' => 'Thing',
'term_fixed' => FALSE,
'chado_table' => '',
'chado_column' => '',
'base_table' => '',
]

◆ $default_settings

ChadoField::$default_settings
static
Initial value:
= [
'storage' => 'field_chado_storage',
]

◆ $download_formatters

ChadoField::$download_formatters
static
Initial value:
= [
'TripalTabDownloader',
'TripalCSVDownloader',
]

The documentation for this class was generated from the following file: