You are here

public function EntityListTrait::settingsSummary in Formatter Suite 8

File

src/Plugin/Field/FieldFormatter/EntityListTrait.php, line 68

Class

EntityListTrait
Formats multiple fields as a list.

Namespace

Drupal\formatter_suite\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $this
    ->sanitizeListSettings();
  $listStyles = $this
    ->getListStyles();
  $listStyle = $this
    ->getSetting('listStyle');
  $listSeparator = $this
    ->getSetting('listSeparator');

  // Summarize.
  $text = $listStyles[$listStyle];
  if ($listStyle === 'span' && empty($listSeparator) === FALSE) {
    $text .= $this
      ->t(', with separator');
  }
  $summary[] = $text;
  return $summary;
}