entityTypeManager = \Drupal::entityTypeManager(); } /** * Compute the values. */ protected function computeValue() { $query = \Drupal::entityQuery('taxonomy_term') ->condition('status', 1) ->condition('vid', 'showroom'); $tids = $query->execute(); shuffle($tids); $terms = entity_load_multiple('taxonomy_term', $tids); // \Drupal::logger('materio_home')->notice(print_r($nodes, true)); $key = 0; foreach ($terms as $tid => $term) { // \Drupal::logger('materio_home')->notice($nid); $this->list[$key] = $this->createItem($key, $term->id()); $key++; } } }