You are here

public function SynonymsEntity::adminSummary in Synonyms 8

Same name and namespace in other branches
  1. 2.0.x modules/synonyms_views_filter/src/Plugin/views/filter/SynonymsEntity.php \Drupal\synonyms_views_filter\Plugin\views\filter\SynonymsEntity::adminSummary()

Display the filter on the administrative summary

Overrides FilterPluginBase::adminSummary

File

synonyms_views_filter/src/Plugin/views/filter/SynonymsEntity.php, line 173

Class

SynonymsEntity
Filter entity by its name or one of its synonyms.

Namespace

Drupal\synonyms_views_filter\Plugin\views\filter

Code

public function adminSummary() {
  if ($this
    ->isExposed()) {
    return $this
      ->t('Exposed');
  }
  $labels = [];
  if (!empty($this->value)) {
    foreach ($this
      ->getEntityStorage()
      ->loadMultiple($this->value) as $entity) {
      $labels[] = $entity
        ->label();
    }
  }
  return $this->operator . ' ' . implode(', ', $labels);
}