public function EntityReferenceEntityFormatter::settingsSummary

Returns a short summary for the current formatter settings.

If an empty result is returned, the formatter is assumed to have no configurable settings, and no UI will be provided to display a settings form.

Return value

array() A short summary of the formatter settings.

Overrides FormatterBase::settingsSummary

File

drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceEntityFormatter.php, line 65
Contains \Drupal\entity_reference\Plugin\field\formatter\EntityReferenceEntityFormatter.

Class

EntityReferenceEntityFormatter
Plugin implementation of the 'entity reference rendered entity' formatter.

Namespace

Drupal\entity_reference\Plugin\field\formatter

Code

public function settingsSummary() {
  $summary = array();
  $view_modes = entity_get_view_modes($this->field['settings']['target_type']);
  $view_mode = $this
    ->getSetting('view_mode');
  $summary[] = t('Rendered as @mode', array(
    '@mode' => isset($view_modes[$view_mode]['label']) ? $view_modes[$view_mode]['label'] : $view_mode,
  ));
  $summary[] = $this
    ->getSetting('links') ? t('Display links') : t('Do not display links');
  return $summary;
}