You are here

public static function TaxonomyManagerTree::isRoot in Taxonomy Manager 8

Same name and namespace in other branches
  1. 2.0.x src/Element/TaxonomyManagerTree.php \Drupal\taxonomy_manager\Element\TaxonomyManagerTree::isRoot()

Helper function to check whether a given term is a root term.

1 call to TaxonomyManagerTree::isRoot()
TaxonomyManagerTree::getFirstPath in src/Element/TaxonomyManagerTree.php
Helper function to calculate path.

File

src/Element/TaxonomyManagerTree.php, line 269

Class

TaxonomyManagerTree
Taxonomy Manager Tree Form Element.

Namespace

Drupal\taxonomy_manager\Element

Code

public static function isRoot($tid) {
  return empty(static::getTermStorage()
    ->loadParents($tid));
}