You are here

public function TaxonomyVocabulary::summary in Context Breadcrumb 8

Provides a human readable summary of the condition's configuration.

Overrides ConditionInterface::summary

File

src/Plugin/Condition/TaxonomyVocabulary.php, line 109

Class

TaxonomyVocabulary
Provides a 'Taxonomy Vocabulary' condition.

Namespace

Drupal\context_breadcrumb\Plugin\Condition

Code

public function summary() {
  if (count($this->configuration['vocabularies']) > 1) {
    $vocabularies = $this->configuration['vocabularies'];
    $last = array_pop($vocabularies);
    $vocabularies = implode(', ', $vocabularies);
    return $this
      ->t('The term vocabulary is @vocabularies or @last', [
      '@vocabularies' => $vocabularies,
      '@last' => $last,
    ]);
  }
  $vocabulary = reset($this->configuration['vocabularies']);
  return $this
    ->t('The term vocabulary is @vocabulary', [
    '@vocabulary' => $vocabulary,
  ]);
}