You are here

public function BlockStyleBase::setConfiguration in Block Style Plugins 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/BlockStyleBase.php \Drupal\block_style_plugins\Plugin\BlockStyleBase::setConfiguration()

Sets the configuration for this plugin instance.

Parameters

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

Overrides ConfigurableInterface::setConfiguration

3 calls to BlockStyleBase::setConfiguration()
BlockStyleBase::getStylesFromVariables in src/Plugin/BlockStyleBase.php
Get styles for a block set in a preprocess $variables array.
BlockStyleBase::prepareForm in src/Plugin/BlockStyleBase.php
Returns the configuration form elements specific to a block configuration.
BlockStyleBase::setStyles in src/Plugin/BlockStyleBase.php
Sets the style configuration for this plugin instance.

File

src/Plugin/BlockStyleBase.php, line 273

Class

BlockStyleBase
Base class for Block style plugins.

Namespace

Drupal\block_style_plugins\Plugin

Code

public function setConfiguration(array $configuration) {

  // TODO: Replace the deprecated defaultStyles() with defaultConfiguration()
  // before 8.x-2.x.
  $this->configuration = NestedArray::mergeDeep($this
    ->defaultStyles(), $configuration);

  // Set the deprecated $styles property.
  // TODO: Remove the deprecated $styles setting before 8.x-2.x.
  $this->styles = $this->configuration;
}