Tripal
Functions
Chado Entity
Collaboration diagram for Chado Entity:

Functions

 chado_get_record_entity_by_bundle (TripalBundle $bundle, $record_id)
 
 chado_get_record_entity_by_table ($data_table, $record_id)
 
 chado_get_bundle_entity_table ($bundle)
 

Detailed Description

Provides an application programming interface (API) to manage entities that use Chado as their base data.

Function Documentation

◆ chado_get_bundle_entity_table()

chado_get_bundle_entity_table (   $bundle)

A helper function that provides the Chado mapping table for the bundle.

The tripal_chado module must map entities to their corresponding record in Chado. Each bundl type has their own table for this mapping. This function provides the name of the table given the bundle name. A mapping table will only map to one table in Chado so the record_id's of the mapping table should always be unique.

Parameters
$bundleA bundle object (as retrieved from tripal_load_bundle_entity().
Returns
The name of the mapping table that Chado uses to map entities to records.

◆ chado_get_record_entity_by_bundle()

chado_get_record_entity_by_bundle ( TripalBundle  $bundle,
  $record_id 
)

Retreive the entity_id assigned to a given record_id and bundle.

Parameters
$bundleA bundle object (as retrieved from tripal_load_bundle_entity().
$record_idThe ID of the record in the Chado table. The record must belong to the table to which the bundle is associated in chado.
Returns
The ID of the entity that belongs to the given record_id.

◆ chado_get_record_entity_by_table()

chado_get_record_entity_by_table (   $data_table,
  $record_id 
)

Retreive the entity_id assigned to a given record_id and base table.

Parameters
$data_tableThe name of the Chado base table.
$record_idThe ID of the record in the Chado table. The record must belong to the table to which the bundle is associated in chado.
Returns
The ID of the entity that belongs to the given record_id, or NULL otherwise.