You are here

public function StatusPropertyFormatter::settingsSummary in Apigee Edge 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/StatusPropertyFormatter.php, line 75

Class

StatusPropertyFormatter
Plugin implementation of the 'status_property' formatter.

Namespace

Drupal\apigee_edge\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  foreach ($this
    ->getStatusLabels() as $status => $label) {
    $value = $this
      ->getSetting($status);
    $summary[] = $this
      ->t('@status_label indicator value: @value', [
      '@status_label' => $label,
      '@value' => $value !== '' ? $value : $this
        ->t('N/A'),
    ]);
  }
  return $summary;
}