You are here

public function EntityReferenceEntityFormatter::settingsSummary in Facebook Instant Articles 8.2

Same name and namespace in other branches
  1. 3.x src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php \Drupal\fb_instant_articles\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter::settingsSummary()

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/EntityReferenceEntityFormatter.php, line 111

Class

EntityReferenceEntityFormatter
Instant articles field formatter for entity reference fields.

Namespace

Drupal\fb_instant_articles\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  $view_modes = $this->entityDisplayRepository
    ->getViewModeOptions($this
    ->getFieldSetting('target_type'));
  $view_mode = $this
    ->getSetting('view_mode');
  $summary[] = $this
    ->t('Rendered as @mode', [
    '@mode' => isset($view_modes[$view_mode]) ? $view_modes[$view_mode] : $view_mode,
  ]);
  return $summary;
}