You are here

public function FieldGroupFormatterPluginManager::prepareConfiguration in Field Group 8.3

Same name and namespace in other branches
  1. 8 src/FieldGroupFormatterPluginManager.php \Drupal\field_group\FieldGroupFormatterPluginManager::prepareConfiguration()

Merges default values for formatter configuration.

Parameters

string $format_type: The format type.

string $context: The context to prepare configuration for.

array $configuration: The configuration of the group.

Return value

array The display properties with defaults added.

1 call to FieldGroupFormatterPluginManager::prepareConfiguration()
FieldGroupFormatterPluginManager::getInstance in src/FieldGroupFormatterPluginManager.php
Overrides PluginManagerBase::getInstance().

File

src/FieldGroupFormatterPluginManager.php, line 106

Class

FieldGroupFormatterPluginManager
Plugin type manager for all fieldgroup formatters.

Namespace

Drupal\field_group

Code

public function prepareConfiguration($format_type, $context, array $configuration) {

  // Fill in defaults for missing properties.
  $configuration += [
    'label' => '',
    'settings' => [],
  ];

  // Fill in default settings values for the formatter.
  $configuration['settings'] += $this
    ->getDefaultSettings($format_type, $context);
  return $configuration;
}