You are here

protected static function WebformTermReferenceTrait::loadTree in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Element/WebformTermReferenceTrait.php \Drupal\webform\Element\WebformTermReferenceTrait::loadTree()

Finds all terms in a given vocabulary ID.

Parameters

string $vid: Vocabulary ID to retrieve terms for.

Return value

object[]|\Drupal\taxonomy\TermInterface[] An array of term objects that are the children of the vocabulary $vid.

4 calls to WebformTermReferenceTrait::loadTree()
WebformTermCheckboxes::getOptionsTree in src/Element/WebformTermCheckboxes.php
Get options to term tree.
WebformTermCheckboxes::processCheckboxes in src/Element/WebformTermCheckboxes.php
Processes a checkboxes form element.
WebformTermReferenceTrait::getOptionsBreadcrumb in src/Element/WebformTermReferenceTrait.php
Get options to term breadcrumb.
WebformTermReferenceTrait::getOptionsTree in src/Element/WebformTermReferenceTrait.php
Get options to term tree.

File

src/Element/WebformTermReferenceTrait.php, line 127

Class

WebformTermReferenceTrait
Trait for term reference elements.

Namespace

Drupal\webform\Element

Code

protected static function loadTree($vid) {

  /** @var \Drupal\taxonomy\TermStorageInterface $taxonomy_storage */
  $taxonomy_storage = \Drupal::entityTypeManager()
    ->getStorage('taxonomy_term');
  return $taxonomy_storage
    ->loadTree($vid, 0, NULL, TRUE);
}