You are here

function _taxonomy_term_depth_get_parent_legacy_d85 in Taxonomy Term Depth 8.2

Gets parent of the term

Parameters

$tid: Term tid to find its parent

1 call to _taxonomy_term_depth_get_parent_legacy_d85()
taxonomy_term_depth_get_parent in ./taxonomy_term_depth.module
Gets parent of the term

File

./taxonomy_term_depth.module, line 140
Main module file.

Code

function _taxonomy_term_depth_get_parent_legacy_d85($tid) {
  $tid = Drupal::database()
    ->query("SELECT parent FROM {taxonomy_term_hierarchy} WHERE tid = :tid", [
    ':tid' => $tid,
  ])
    ->fetchField();
  return $tid;
}