entityTypeManager = \Drupal::entityTypeManager(); } /** * Compute the values. */ protected function computeValue() { $query = \Drupal::entityQuery('taxonomy_term') ->condition('status', 1) ->condition('vid', 'showroom'); // remove masqué $tids = $query->execute(); shuffle($tids); foreach ($tids as $key => $tid) { $term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($tid); $sid = WorkflowManager::getCurrentStateId($term, 'field_workflow'); if($sid != 'workflow_visible') continue; $this->list[$key] = $this->createItem($key, $tid); } } }