You are here

function _lineage_get_parent_lineage in Taxonomy Lineage 6

Same name and namespace in other branches
  1. 5 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 265

Code

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