You are here

public function EntityReferenceFacetFormatterBase::settingsSummary in Entity Reference Facet Link 8

Returns a short summary for the current formatter settings.

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

Return value

string[] A short summary of the formatter settings.

Overrides FormatterBase::settingsSummary

File

src/Plugin/Field/FieldFormatter/EntityReferenceFacetFormatterBase.php, line 132

Class

EntityReferenceFacetFormatterBase

Namespace

Drupal\entity_reference_facet_link\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  if ($facet = $this
    ->getFacet()) {
    $summary[] = $this
      ->t('Selected facet: @facet', [
      '@facet' => $facet
        ->label(),
    ]);
  }
  else {
    $summary[] = $this
      ->t('No facet selected');
  }
  return $summary;
}