function PluginSettingsBase::mergeDefaults

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Field/PluginSettingsBase.php \Drupal\Core\Field\PluginSettingsBase::mergeDefaults()
  2. 10 core/lib/Drupal/Core/Field/PluginSettingsBase.php \Drupal\Core\Field\PluginSettingsBase::mergeDefaults()
  3. 11.x 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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.