You are here

public function FieldGroupFormatterPluginManager::prepareConfiguration in Field Group 8

Same name and namespace in other branches
  1. 8.3 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 $properties: An array of formatter configuration.

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 109

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 += array(
    'label' => '',
    'settings' => array(),
  );

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