You are here

private function TaxonomyColor::getTermIds in Fullcalendar View 6.x

Same name and namespace in other branches
  1. 8.3 src/TaxonomyColor.php \Drupal\fullcalendar_view\TaxonomyColor::getTermIds()
  2. 8 src/TaxonomyColor.php \Drupal\fullcalendar_view\TaxonomyColor::getTermIds()
  3. 8.2 src/TaxonomyColor.php \Drupal\fullcalendar_view\TaxonomyColor::getTermIds()
  4. 5.x src/TaxonomyColor.php \Drupal\fullcalendar_view\TaxonomyColor::getTermIds()

Get all terms of a vocabulary.

1 call to TaxonomyColor::getTermIds()
TaxonomyColor::colorInputBoxs in src/TaxonomyColor.php
Color input box for taxonomy terms of a vocabulary.

File

src/TaxonomyColor.php, line 74

Class

TaxonomyColor
Class TaxonomyColor.

Namespace

Drupal\fullcalendar_view

Code

private function getTermIds($vid) {
  if (empty($vid)) {
    return [];
  }
  $terms =& drupal_static(__FUNCTION__);

  // Get taxonomy terms from database if they haven't been loaded.
  if (!isset($terms[$vid])) {

    // Get terms Ids.
    $query = $this->entityTypeManager
      ->getStorage('taxonomy_term')
      ->getQuery();
    $query
      ->condition('vid', $vid);
    $tids = $query
      ->execute();
    $terms[$vid] = $this->entityTypeManager
      ->getStorage('taxonomy_term')
      ->loadMultiple($tids);
  }
  return $terms;
}