You are here

public function EntityReferenceExportFormatter::settingsSummary in REST Views 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldFormatter/EntityReferenceExportFormatter.php \Drupal\rest_views\Plugin\Field\FieldFormatter\EntityReferenceExportFormatter::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 EntityReferenceEntityFormatter::settingsSummary

File

src/Plugin/Field/FieldFormatter/EntityReferenceExportFormatter.php, line 144

Class

EntityReferenceExportFormatter
A plugin that creates a serializable form of a rendered entity.

Namespace

Drupal\rest_views\Plugin\Field\FieldFormatter

Code

public function settingsSummary() : array {
  $summary = parent::settingsSummary();
  $fields = $this
    ->getSetting('extra');
  if ($fields) {
    $summary[] = $this
      ->t('Includes %data', [
      '%data' => implode(', ', $fields),
    ]);
  }
  return $summary;
}