You are here

public function ShortcodeBase::setConfiguration in Shortcode 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/ShortcodeBase.php \Drupal\shortcode\Plugin\ShortcodeBase::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 ShortcodeBase::setConfiguration()
ShortcodeBase::__construct in src/Plugin/ShortcodeBase.php
Constructs a \Drupal\Component\Plugin\PluginBase object.

File

src/Plugin/ShortcodeBase.php, line 88

Class

ShortcodeBase
Provides a base class for Shortcode plugins.

Namespace

Drupal\shortcode\Plugin

Code

public function setConfiguration(array $configuration) {
  if (isset($configuration['status'])) {
    $this->status = (bool) $configuration['status'];
  }
  if (isset($configuration['settings'])) {
    $this->settings = (array) $configuration['settings'];
  }
  return $this;
}