You are here

public function ExtraFieldPlusDisplayBase::getSettings in Extra Field Settings Provider 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/ExtraFieldPlusDisplayBase.php \Drupal\extra_field_plus\Plugin\ExtraFieldPlusDisplayBase::getSettings()

Returns field settings.

Return value

array The field settings.

Overrides ExtraFieldPlusDisplayInterface::getSettings

3 calls to ExtraFieldPlusDisplayBase::getSettings()
ExampleNodeLabel::view in modules/extra_field_plus_example/src/Plugin/ExtraField/Display/ExampleNodeLabel.php
ExampleNodeLabelFormatted::viewElements in modules/extra_field_plus_example/src/Plugin/ExtraField/Display/ExampleNodeLabelFormatted.php
ExtraFieldPlusDisplayBase::getSetting in src/Plugin/ExtraFieldPlusDisplayBase.php
Returns field setting.

File

src/Plugin/ExtraFieldPlusDisplayBase.php, line 18

Class

ExtraFieldPlusDisplayBase
Base class for Extra field Plus Display plugins.

Namespace

Drupal\extra_field_plus\Plugin

Code

public function getSettings() {
  $field_id = 'extra_field_' . $this
    ->getPluginId();
  $display = $this
    ->getEntityViewDisplay();
  $component = $display
    ->getComponent($field_id);
  $default_settings = (array) $this
    ->getDefaultFormValues();
  if (!empty($component['settings'])) {
    $settings = array_merge($default_settings, array_intersect_key($component['settings'], $default_settings));
  }
  else {
    $settings = $default_settings;
  }
  return $settings;
}