You are here

public function WebformHandlerBase::setConfiguration in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformHandlerBase.php \Drupal\webform\Plugin\WebformHandlerBase::setConfiguration()

Sets the configuration for this plugin instance.

Parameters

array $configuration: An associative array containing the plugin's configuration.

Overrides ConfigurableInterface::setConfiguration

File

src/Plugin/WebformHandlerBase.php, line 415

Class

WebformHandlerBase
Provides a base class for a webform handler.

Namespace

Drupal\webform\Plugin

Code

public function setConfiguration(array $configuration) {
  $configuration += [
    'handler_id' => '',
    'label' => '',
    'notes' => '',
    'status' => 1,
    'conditions' => [],
    'weight' => '',
    'settings' => [],
  ];
  $this->configuration = $configuration['settings'] + $this
    ->defaultConfiguration();
  $this->handler_id = $configuration['handler_id'];
  $this->label = $configuration['label'];
  $this->notes = $configuration['notes'];
  $this->status = $configuration['status'];
  $this->conditions = $configuration['conditions'];
  $this->weight = $configuration['weight'];
  return $this;
}