Tripal
Modules | Functions
Chado
Collaboration diagram for Chado:

Modules

 Chado Analysis
 
 Chado Assay
 
 Chado Biomaterial
 
 Chado Contact
 
 Chado CV
 
 Chado DB
 
 Chado Feature
 
 Chado Featuremap
 
 Tripal_chado_module_DEPRECATED_api
 
 Chado Organism
 
 Chado Phylotree
 
 Chado Project
 
 Chado Publication
 
 Chado Stock
 
 Chado Study
 
 Chado Custom Tables
 
 Tripal_chado_DEPRECATED_api
 
 Chado Entity
 
 Chado Entity
 
 Chado Materalized Views
 
 Chado Query
 
 Chado Schema
 
 Semantic Web
 
 Semantic Web
 
 Chado Views Integration
 

Functions

 chado_publish_records ($values, $job=NULL)
 
 chado_get_tokens ($base_table)
 
 chado_replace_tokens ($string, $record)
 

Detailed Description

The Tripal Chado API is a set of functions for interacting with data inside of a Chado relational database. Entities (or pages) in Drupal that are provided by Tripal can supply data from any supported database back-end, and Chado is the default. This API contains a variety of sub categories (or groups) where functions are organized. Any extension module that desires to work with data in Chado will find these functions useful.

Function Documentation

◆ chado_get_tokens()

chado_get_tokens (   $base_table)

Returns an array of tokens based on Tripal Entity Fields.

Parameters
$base_tableThe name of a base table in Chado.
Returns
An array of tokens where the key is the machine_name of the token.

◆ chado_publish_records()

chado_publish_records (   $values,
  $job = NULL 
)

Publishes content in Chado as a new TripalEntity entity.

Parameters
$valuesA key/value associative array that supports the following keys:
  • bundle_name: The name of the the TripalBundle (e.g. bio_data-12345).
$jobThe jobs management object for the job if this function is run as a job. This argument is added by Tripal during a job run and is not needed if this function is run directly.
Returns
boolean TRUE if all of the records of the given bundle type were published, and FALSE if a failure occured.

◆ chado_replace_tokens()

chado_replace_tokens (   $string,
  $record 
)

Replace all Chado Tokens in a given string.

NOTE: If there is no value for a token then the token is removed.

Parameters
string$stringThe string containing tokens.
$recordA Chado record as generated by chado_generate_var()
Returns
The string will all tokens replaced with values.