You are here

function _taxonomy_term_depth_get_parent_d86 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_d86()
taxonomy_term_depth_get_parent in ./taxonomy_term_depth.module
Gets parent of the term

File

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

Code

function _taxonomy_term_depth_get_parent_d86($tid) {
  $tid = Drupal::database()
    ->query("SELECT parent_target_id FROM {taxonomy_term__parent} WHERE entity_id = :tid", [
    ':tid' => $tid,
  ])
    ->fetchField();
  return $tid;
}