Tripal v1.0 (6.x-1.0)
|
Go to the source code of this file.
Classes | |
class | views_handler_join_chado_through_linking |
Handler to allow joins between records via a linking table
Example Usage: To join the analysis table to the feature table through the analysisfeature table, (ie: get analysis fields to show up in a feature view) Use the following code in the analysis hook_views_data:
$data['analysis']['table']['join']['feature'] = array( 'linking' => array( 'table' => 'analysisfeature', 'left_field' => 'feature_id', 'field' => 'analysis_id', ), 'left_field' => 'feature_id', 'field' => 'analysis_id', 'handler' => 'views_handler_join_chado_through_linking' );
NOTE: If the right table is in the drupal schema rather then the chado schema (ie: node, chado_feature) then add the following to the above join description:
'table_is_drupal' => TRUE
This will ensure the drupal table is surrounded by { } and as such any database prefixes are added correctly. If the left table is in the drupal schema it should already be defined by a previous join (or the From clause).
Definition in file views_handler_join_chado_through_linking.inc.