|
@@ -257,9 +257,11 @@ function tripal_chado_vocab_get_term_children($vocabulary, $accession) {
|
|
|
* This hook is created by the Tripal module and is not a Drupal hook.
|
|
|
*/
|
|
|
function tripal_chado_vocab_get_term($vocabulary, $accession) {
|
|
|
+ // Cache ID for this term:
|
|
|
+ $cid = 'tripal_chado:term:' . $vocabulary . ':' . $accession;
|
|
|
|
|
|
- // Check the cache fisrt. Get the term from cache if it's available
|
|
|
- $cache = cache_get('tripal_chado:term:' . $vocabulary . ':' . $accession);
|
|
|
+ // Check the cache first. Get the term from cache if it's available
|
|
|
+ $cache = cache_get($cid, 'cache');
|
|
|
if (isset($cache->data)) {
|
|
|
return $cache->data;
|
|
|
}
|
|
@@ -292,7 +294,7 @@ function tripal_chado_vocab_get_term($vocabulary, $accession) {
|
|
|
|
|
|
// Cache the term to reduce the amount of queries sent to the database
|
|
|
$term = _tripal_chado_format_term_description($cvterm);
|
|
|
- cache_set('tripal_chado:term:' . $vocabulary . ':' . $accession, $term);
|
|
|
+ cache_set($cid, $term, 'cache', CACHE_TEMPORARY);
|
|
|
return $term;
|
|
|
}
|
|
|
|