WebformPluginSettingsTrait.php in Webform 6.x
File
src/Plugin/WebformPluginSettingsTrait.php
View source
<?php
namespace Drupal\webform\Plugin;
trait WebformPluginSettingsTrait {
public function getSettings() {
$configuration = $this
->getConfiguration();
return $configuration['settings'];
}
public function setSettings(array $settings) {
$configuration = $this
->getConfiguration();
$configuration['settings'] = $settings + $configuration['settings'];
$this
->setConfiguration($configuration);
return $this;
}
public function getSetting($key) {
$configuration = $this
->getConfiguration();
return isset($configuration['settings'][$key]) ? $configuration['settings'][$key] : NULL;
}
public function setSetting($key, $value) {
$configuration = $this
->getConfiguration();
$configuration['settings'][$key] = $value;
return $this
->setConfiguration($configuration);
}
}