function tripal_chado_vocab_get_term

3.x tripal_chado.vocab_storage.inc tripal_chado_vocab_get_term($vocabulary, $accession)

Implements hook_vocab_get_term().

This hook is created by the Tripal module and is not a Drupal hook.

1 call to tripal_chado_vocab_get_term()

File

tripal_chado/includes/tripal_chado.vocab_storage.inc, line 252

Code

function tripal_chado_vocab_get_term($vocabulary, $accession) {

  // It's possible that Chado is not available (i.e. it gets renamed
  // for copying) but Tripal has already been prepared and the
  // entities exist.  If this is the case we don't want to run the
  // commands below.
  if (!chado_table_exists('cvterm')) {
    return FALSE;
  }

  $match = array(
    'dbxref_id' => array(
      'db_id' => array(
        'name' => $vocabulary,
      ),
      'accession' => $accession,
    ),
  );
  $cvterm = chado_generate_var('cvterm', $match);
  if (!$cvterm) {
    return FALSE;
  }
  $cvterm = chado_expand_var($cvterm, 'field', 'cvterm.definition');

  return _tripal_chado_format_term_description($cvterm);
}