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.
◆ chado_get_tokens()
chado_get_tokens |
( |
|
$base_table | ) |
|
Returns an array of tokens based on Tripal Entity Fields.
- Parameters
-
$base_table | The 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
-
$values | A key/value associative array that supports the following keys:
- bundle_name: The name of the the TripalBundle (e.g. bio_data-12345).
|
$job | The 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 | $string | The string containing tokens. |
| $record | A Chado record as generated by chado_generate_var() |
- Returns
- The string will all tokens replaced with values.