trait WebformPluginSettingsTrait in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Plugin/WebformPluginSettingsTrait.php \Drupal\webform\Plugin\WebformPluginSettingsTrait
Provides a plugin settings trait.
Hierarchy
- trait \Drupal\webform\Plugin\WebformPluginSettingsTrait
File
- src/
Plugin/ WebformPluginSettingsTrait.php, line 8
Namespace
Drupal\webform\PluginView source
trait WebformPluginSettingsTrait {
/**
* {@inheritdoc}
*/
public function getSettings() {
$configuration = $this
->getConfiguration();
return $configuration['settings'];
}
/**
* {@inheritdoc}
*/
public function setSettings(array $settings) {
$configuration = $this
->getConfiguration();
$configuration['settings'] = $settings + $configuration['settings'];
$this
->setConfiguration($configuration);
return $this;
}
/**
* {@inheritdoc}
*/
public function getSetting($key) {
$configuration = $this
->getConfiguration();
return isset($configuration['settings'][$key]) ? $configuration['settings'][$key] : NULL;
}
/**
* {@inheritdoc}
*/
public function setSetting($key, $value) {
$configuration = $this
->getConfiguration();
$configuration['settings'][$key] = $value;
return $this
->setConfiguration($configuration);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
WebformPluginSettingsTrait:: |
public | function | ||
WebformPluginSettingsTrait:: |
public | function | ||
WebformPluginSettingsTrait:: |
public | function | ||
WebformPluginSettingsTrait:: |
public | function |