You are here

protected function PluginSettingsBase::mergeDefaults in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/PluginSettingsBase.php \Drupal\Core\Field\PluginSettingsBase::mergeDefaults()

Merges default settings values into $settings.

2 calls to PluginSettingsBase::mergeDefaults()
PluginSettingsBase::getSetting in core/lib/Drupal/Core/Field/PluginSettingsBase.php
Returns the value of a setting, or its default value if absent.
PluginSettingsBase::getSettings in core/lib/Drupal/Core/Field/PluginSettingsBase.php
Returns the array of settings, including defaults for missing settings.

File

core/lib/Drupal/Core/Field/PluginSettingsBase.php, line 70

Class

PluginSettingsBase
Base class for the Field API plugins.

Namespace

Drupal\Core\Field

Code

protected function mergeDefaults() {
  $this->settings += static::defaultSettings();
  $this->defaultSettingsMerged = TRUE;
}