You are here

public function WidgetBase::setConfiguration in Entity Browser 8

Same name and namespace in other branches
  1. 8.2 src/WidgetBase.php \Drupal\entity_browser\WidgetBase::setConfiguration()

Sets the configuration for this plugin instance.

Parameters

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

Overrides ConfigurableInterface::setConfiguration

1 call to WidgetBase::setConfiguration()
WidgetBase::__construct in src/WidgetBase.php
WidgetBase constructor.

File

src/WidgetBase.php, line 180

Class

WidgetBase
Base class for widget plugins.

Namespace

Drupal\entity_browser

Code

public function setConfiguration(array $configuration) {
  $configuration += [
    'settings' => [],
    'uuid' => '',
    'weight' => '',
    'label' => '',
    'id' => '',
  ];
  $this->configuration = NestedArray::mergeDeep($this
    ->defaultConfiguration(), $configuration['settings']);
  $this->label = $configuration['label'];
  $this->weight = $configuration['weight'];
  $this->uuid = $configuration['uuid'];
  $this->id = $configuration['id'];
}