function chado_retrieve_node_form_dbxrefs

2.x chado_retrieve_node_form_dbxrefs($node)

This function is used in a hook_insert, hook_update for a node form when the additional_dbxrefs form has been added to the form. It retrieves all of the dbxrefs and returns them in an array of the format:

$dbxefs[<db_id>][<version>][<dbxref_id>] = <accession>

This array can then be used for inserting or updating dbxrefs using the API call tripal_hook_insert_dbxref()



Return value

A dbxref array

Related topics

2 calls to chado_retrieve_node_form_dbxrefs()
chado_node_additional_dbxrefs_form_retreive in tripal_core/api/
chado_update_node_form_dbxrefs in tripal_core/api/
This function is used in hook_insert or hook_update and handles inserting of any new dbxrefs and creation of links between those dbxrefs and node content
1 string reference to 'chado_retrieve_node_form_dbxrefs'


tripal_core/api/, line 635
API to manage the chado _dbxref table for various Tripal Node Types


function chado_retrieve_node_form_dbxrefs($node) {
  $dbxrefs = array();

  if (isset($node->dbxref_table)) {
    foreach ($node->dbxref_table as $db_id => $elements) {
      if ($db_id != 'new') {
        foreach ($elements as $dbxref_id => $dbxref) {
          $version = (!empty($dbxref['version'])) ? $dbxref['version'] : 'NONE';
          $dbxrefs[$db_id][$version][$dbxref_id] = $dbxref['accession'];

  return $dbxrefs;