You are here

function taxonomy_term_depth_get_full_chain in Taxonomy Term Depth 7

Same name and namespace in other branches
  1. 8.2 taxonomy_term_depth.module \taxonomy_term_depth_get_full_chain()
  2. 8 taxonomy_term_depth.module \taxonomy_term_depth_get_full_chain()

Gets full chain of terms, including term itself

Parameters

$tid:

Return value

array

1 call to taxonomy_term_depth_get_full_chain()
DynamicDepthCalculationTest::testCalculateDepth in ./taxonomy_term_depth.test
Creates and ensures that a feed is unique, checks source, and deletes feed.

File

./taxonomy_term_depth.module, line 190
Provides some custom functionality.

Code

function taxonomy_term_depth_get_full_chain($tid, $reversed = FALSE) {
  $parents = taxonomy_term_depth_get_parents($tid, TRUE);
  $children = taxonomy_term_depth_get_children($tid, TRUE);
  $chain = array_merge($parents, [
    $tid,
  ], $children);
  return $reversed ? array_reverse($chain) : $chain;
}