You are here

protected function PatternSettingTypeBase::getValue in UI Patterns Settings 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/PatternSettingTypeBase.php \Drupal\ui_patterns_settings\Plugin\PatternSettingTypeBase::getValue()

Return value if set otherwise take the default value.

Parameters

mixed $value: The provided value.

Return value

string The value for this setting

9 calls to PatternSettingTypeBase::getValue()
AttributesSettingType::settingsForm in src/Plugin/UiPatterns/SettingType/AttributesSettingType.php
Returns the configuration form elements specific to this settings plugin..
BooleanSettingType::settingsForm in src/Plugin/UiPatterns/SettingType/BooleanSettingType.php
Returns the configuration form elements specific to this settings plugin..
CheckboxesSettingType::settingsForm in src/Plugin/UiPatterns/SettingType/CheckboxesSettingType.php
Returns the configuration form elements specific to this settings plugin..
EnumerationSettingTypeBase::settingsForm in src/Plugin/EnumerationSettingTypeBase.php
Returns the configuration form elements specific to this settings plugin..
MediaLibrarySettingType::settingsForm in src/Plugin/UiPatterns/SettingType/MediaLibrarySettingType.php
Returns the configuration form elements specific to this settings plugin..

... See full list

1 method overrides PatternSettingTypeBase::getValue()
ColorWidgetSettingType::getValue in src/Plugin/UiPatterns/SettingType/ColorWidgetSettingType.php
Return value if set otherwise take the default value.

File

src/Plugin/PatternSettingTypeBase.php, line 91

Class

PatternSettingTypeBase
Base class for UI Patterns Setting plugins.

Namespace

Drupal\ui_patterns_settings\Plugin

Code

protected function getValue($value) {
  if ($value === NULL) {
    return $this
      ->getPatternSettingDefinition()
      ->getDefaultValue();
  }
  else {
    return $value === NULL ? "" : $value;
  }
}