You are here

function _lineage_get_parent_lineage in Taxonomy Lineage 5

Same name and namespace in other branches
  1. 6 lineage.module \_lineage_get_parent_lineage()
  2. 7 lineage.module \_lineage_get_parent_lineage()
1 call to _lineage_get_parent_lineage()
lineage_update_term in ./lineage.module

File

./lineage.module, line 78

Code

function _lineage_get_parent_lineage($tid) {
  if (!$tid) {
    return array();
  }
  $term = db_fetch_object(db_query("SELECT td.tid, td.name, td.weight, th.parent FROM {term_hierarchy} th LEFT JOIN {term_data} td ON td.tid = th.tid WHERE td.tid = '%d'", $tid));
  if (!$term->tid) {
    return $ret;
  }
  $ret = _lineage_get_parent_lineage($term->parent);
  $ret['base'] .= lineage_string($term);
  $ret['depth'] += 1;
  return array();
}