You are here

function TermReference::adminSummary in EntityFieldQuery Views Backend 8

Display the filter on the administrative summary

Overrides InOperator::adminSummary

File

src/Plugin/views/filter/TermReference.php, line 351
Contains \Drupal\efq_views\Plugin\views\filter\FieldInOperator.

Class

TermReference
Filter by term id.

Namespace

Drupal\efq_views\Plugin\views\filter

Code

function adminSummary() {

  // set up $this->valueOptions for the parent summary
  $this->valueOptions = array();
  if ($this->value) {
    $this->value = array_filter($this->value);
    $query = new EntityFieldQuery();
    $result = $query
      ->entityCondition('entity_type', 'taxonomy_term')
      ->entityCondition('entity_id', $this->value)
      ->execute();
    if (!empty($result['taxonomy_term'])) {
      $terms = entity_load('taxonomy_term', array_keys($result['taxonomy_term']));
      foreach ($terms as $term) {
        $this->valueOptions[$term->tid] = $term->name;
      }
    }
  }
  return parent::adminSummary();
}