function hook_vocab_add_term

3.x tripal.terms.api.inc hook_vocab_add_term($details)

Hook used by the default term storage backend to add new terms.

Parameters

$details: An array with at least the following keys: -vocabulary : An associative array with the following keys: -name: The short name for the vocabulary (e.g. SO, PATO, etc). -description: The description of this vocabulary. -url: The URL for the vocabulary. -urlprefix: (optional) A URL to which the short_name and term accession can be appended to form a complete URL for a term. If the prefix does not support appending then the exact location for the position of the short_name and the term accession will be specified with the {db} and {accession} tags respectively. -accession : The name unique ID of the term. -url : The URL for the term. -name : The name of the term. -definition : The term's description.

Return value

TRUE if the term was added, FALSE otherwise. If the term already exists it will be updated and the return value will be TRUE.

Related topics

1 function implements hook_vocab_add_term()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

tripal_chado_vocab_add_term in tripal_chado/includes/tripal_chado.vocab_storage.inc
Implements hook_vocab_add_term().

File

tripal/api/tripal.terms.api.inc, line 306
Provides an application programming interface (API) for working with controlled vocaublary terms.

Code

function hook_vocab_add_term($details) {
  // See the tripal_chado_vocab_set_term() function for an example.
}