You are here

public static function AmazonFieldFormatter::defaultSettings in Amazon Product Advertisement API 8.2

Defines the default settings for this plugin.

Return value

array A list of default settings, keyed by the setting name.

Overrides PluginSettingsBase::defaultSettings

File

modules/amazon_field/src/Plugin/Field/FieldFormatter/AmazonFieldFormatter.php, line 47

Class

AmazonFieldFormatter
Plugin implementation of the 'amazon_field_formatter' formatter.

Namespace

Drupal\amazon_field\Plugin\Field\FieldFormatter

Code

public static function defaultSettings() {
  $defaultMaxAge = \Drupal::config('amazon.settings')
    ->get('default_max_age');
  if (is_null($defaultMaxAge)) {
    throw new \InvalidArgumentException('Missing Amazon settings: default max age.');
  }
  return array(
    'max_age' => $defaultMaxAge,
    'template' => 'image_large',
    'advanced' => [
      'extraResponseGroups' => '',
    ],
  ) + parent::defaultSettings();
}