You are here

private function FilterOnomasticon::getTaxonomyTerms in Onomasticon 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/Filter/FilterOnomasticon.php \Drupal\onomasticon\Plugin\Filter\FilterOnomasticon::getTaxonomyTerms()

Singleton to retrieve all terms.

Return value

Term[]

1 call to FilterOnomasticon::getTaxonomyTerms()
FilterOnomasticon::replaceTerms in src/Plugin/Filter/FilterOnomasticon.php
This is the actual filter function.

File

src/Plugin/Filter/FilterOnomasticon.php, line 358

Class

FilterOnomasticon
Plugin annotation @Filter( id = "filter_onomasticon", title = @Translation("Onomasticon Filter"), description = @Translation("Adds glossary information to words."), type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE, settings…

Namespace

Drupal\onomasticon\Plugin\Filter

Code

private function getTaxonomyTerms() {
  if (empty($this->terms)) {
    $terms = \Drupal::entityTypeManager()
      ->getStorage('taxonomy_term')
      ->loadTree($this->settings['onomasticon_vocabulary'], 0, NULL, true);
  }
  \Drupal::moduleHandler()
    ->alter('onomasticon_terms', $terms);
  if (is_array($terms)) {
    $this->terms = $terms;
  }
  return $this->terms;
}