You are here

public static function ShsTermSelect::buildOptions in Webform Simple Hierarchical Select 8

Build a list of term options for provided vocabulary.

Parameters

string $vid: Vocabulary id.

bool $cache_options: Should we use cache?

Return value

array An associative array of terms, where keys are tid and values are term name.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

1 call to ShsTermSelect::buildOptions()
ShsTermSelect::getOptions in src/Element/ShsTermSelect.php
Get options of all terms in given vocabulary.

File

src/Element/ShsTermSelect.php, line 223

Class

ShsTermSelect
Provides a webform element for an shs term select menu.

Namespace

Drupal\webform_shs\Element

Code

public static function buildOptions($vid, $cache_options = FALSE) {
  if ($cache_options) {
    $options = self::buildCachedTermOptions($vid);
  }
  else {
    $options = self::buildTermOptions($vid);
  }
  return $options;
}