Tripal
Functions
tripal_chado.variables.api.php File Reference

Functions

 chado_generate_var ($table, $values, $base_options=[], $schema_name=NULL)
 
 chado_expand_var ($object, $type, $to_expand, $table_options=[], $schema_name=NULL)
 
 tripal_chado_exclude_type_by_default ()
 

Detailed Description

This API generates objects containing the full details of a record(s) in chado.

Function Documentation

◆ tripal_chado_exclude_type_by_default()

tripal_chado_exclude_type_by_default ( )

Implements hook_exclude_type_by_default()

This hooks allows fields of a specified type that match a specified criteria to be excluded by default from any table when chado_generate_var() is called. Keep in mind that if fields are excluded by default they can always be expanded at a later date using chado_expand_var().

Criteria are php strings that evaluate to either TRUE or FALSE. These strings are evaluated using php's eval(). There are watchdog entries of type tripal stating the exact criteria evaluated. Criteria can contain the following tokens:

  • <field_name> Replaced by the name of the field to be excluded
  • <field_value> Replaced by the value of the field in the current record Also keep in mind that if your criteria doesn't contain the <field_value> token then it will be evaluated before the query is executed and if the field is excluded it won't be included in the query.
Returns
An array of type => criteria where the type is excluded if the criteria evaluates to TRUE