TermStorage::loadTree

public TermStorage::loadTree($vid, $parent = 0, $max_depth = NULL, $load_entities = FALSE) Finds all terms in a given vocabulary ID. Parameters string $vid: Vocabulary ID to retrieve terms for. int $parent: The term ID under which to generate the tree. If 0, generate the tree for the entire vocabulary. int $max_depth: The number of levels of the tree to return. Leave NULL to return all levels. bool $load_entities: If TRUE, a full entity load will occur on the term objects. Otherwise they are p

TermStorage::loadParents

public TermStorage::loadParents($tid) Finds all parents of a given term ID. Parameters int $tid: Term ID to retrieve parents for. Return value \Drupal\taxonomy\TermInterface[] An array of term objects which are the parents of the term $tid. Overrides TermStorageInterface::loadParents File core/modules/taxonomy/src/TermStorage.php, line 121 Class TermStorage Defines a Controller class for taxonomy terms. Namespace Drupal\taxonomy Code public function loadParents($tid) { if (!isset($

TermStorage::loadChildren

public TermStorage::loadChildren($tid, $vid = NULL) Finds all children of a term ID. Parameters int $tid: Term ID to retrieve parents for. string $vid: An optional vocabulary ID to restrict the child search. Return value \Drupal\taxonomy\TermInterface[] An array of term objects that are the children of the term $tid. Overrides TermStorageInterface::loadChildren File core/modules/taxonomy/src/TermStorage.php, line 170 Class TermStorage Defines a Controller class for taxonomy terms. Name

TermStorage::loadAllParents

public TermStorage::loadAllParents($tid) Finds all ancestors of a given term ID. Parameters int $tid: Term ID to retrieve ancestors for. Return value \Drupal\taxonomy\TermInterface[] An array of term objects which are the ancestors of the term $tid. Overrides TermStorageInterface::loadAllParents File core/modules/taxonomy/src/TermStorage.php, line 143 Class TermStorage Defines a Controller class for taxonomy terms. Namespace Drupal\taxonomy Code public function loadAllParents($tid) {

TermStorage::getNodeTerms

public TermStorage::getNodeTerms(array $nids, array $vocabs = array(), $langcode = NULL) Returns all terms used to tag some given nodes. Parameters array $nids: Node IDs to retrieve terms for. array $vocabs: (optional) A vocabularies array to restrict the term search. Defaults to empty array. string $langcode: (optional) A language code to restrict the term search. Defaults to NULL. Return value array An array of nids and the term entities they were tagged with. Overrides TermStorageInterface

TermStorage::deleteTermHierarchy

public TermStorage::deleteTermHierarchy($tids) Removed reference to terms from term_hierarchy. Parameters array $tids: Array of terms that need to be removed from hierarchy. Overrides TermStorageInterface::deleteTermHierarchy File core/modules/taxonomy/src/TermStorage.php, line 96 Class TermStorage Defines a Controller class for taxonomy terms. Namespace Drupal\taxonomy Code public function deleteTermHierarchy($tids) { $this->database->delete('taxonomy_term_hierarchy') -&g

TermStorage::create

public TermStorage::create(array $values = array()) Parameters array $values: An array of values to set, keyed by property name. A value for the vocabulary ID ('vid') is required. Overrides EntityStorageBase::create File core/modules/taxonomy/src/TermStorage.php, line 69 Class TermStorage Defines a Controller class for taxonomy terms. Namespace Drupal\taxonomy Code public function create(array $values = array()) { // Save new terms with no parents by default. if (empty($values['pa

TermStorage::$treeTerms

Array of terms in a tree keyed by vocabulary ID and term ID. Type: array File core/modules/taxonomy/src/TermStorage.php, line 53 Class TermStorage Defines a Controller class for taxonomy terms. Namespace Drupal\taxonomy Code protected $treeTerms = array();

TermStorage::$trees

Array of loaded trees keyed by a cache id matching tree arguments. Type: array File core/modules/taxonomy/src/TermStorage.php, line 60 Class TermStorage Defines a Controller class for taxonomy terms. Namespace Drupal\taxonomy Code protected $trees = array();

TermStorage::$treeParents

Array of term parents keyed by vocabulary ID and child term ID. Type: array File core/modules/taxonomy/src/TermStorage.php, line 39 Class TermStorage Defines a Controller class for taxonomy terms. Namespace Drupal\taxonomy Code protected $treeParents = array();