You are here

public function EntityReferenceSynonymsAutocomplete::settingsSummary in Synonyms 2.0.x

Returns a short summary for the current widget settings.

If an empty result is returned, a UI can still be provided to display a settings form in case the widget has configurable settings.

Return value

array A short summary of the widget settings.

Overrides WidgetBase::settingsSummary

File

modules/synonyms_autocomplete/src/Plugin/Field/FieldWidget/EntityReferenceSynonymsAutocomplete.php, line 71

Class

EntityReferenceSynonymsAutocomplete
Plugin implementation of the 'synonyms friendly autocomplete' widget.

Namespace

Drupal\synonyms_autocomplete\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $summary[] = $this
    ->t('Suggestion size: @size', [
    '@size' => $this
      ->getSetting('suggestion_size'),
  ]);
  $summary[] = $this
    ->t('Only unique: @unique', [
    '@unique' => $this
      ->getSetting('suggest_only_unique') ? $this
      ->t('Yes') : $this
      ->t('No'),
  ]);
  $summary[] = $this
    ->t('Match: @match', [
    '@match' => $this
      ->getMatchOperatorOptions()[$this
      ->getSetting('match')],
  ]);
  return $summary;
}