class ConfigurablePlugin

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php \Drupal\Tests\Core\Plugin\ConfigurablePlugin
  2. 8.9.x core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php \Drupal\Tests\Core\Plugin\ConfigurablePlugin
  3. 11.x core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php \Drupal\Tests\Core\Plugin\ConfigurablePlugin

Hierarchy

Expanded class hierarchy of ConfigurablePlugin

File

core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php, line 110

Namespace

Drupal\Tests\Core\Plugin
View source
class ConfigurablePlugin extends PluginBase implements ConfigurableInterface {
    public function __construct(array $configuration, $plugin_id, $plugin_definition) {
        parent::__construct($configuration, $plugin_id, $plugin_definition);
        $this->configuration = $configuration + $this->defaultConfiguration();
    }
    public function defaultConfiguration() {
        return [];
    }
    public function getConfiguration() {
        return $this->configuration;
    }
    public function setConfiguration(array $configuration) {
        $this->configuration = $configuration;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
ConfigurablePlugin::defaultConfiguration public function Overrides ConfigurableInterface::defaultConfiguration
ConfigurablePlugin::getConfiguration public function Overrides ConfigurableInterface::getConfiguration
ConfigurablePlugin::setConfiguration public function Overrides ConfigurableInterface::setConfiguration
ConfigurablePlugin::__construct public function Overrides PluginBase::__construct
PluginBase::$configuration protected property Configuration information passed into the plugin.
PluginBase::$pluginDefinition protected property The plugin implementation definition.
PluginBase::$pluginId protected property The plugin ID.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Overrides PluginInspectionInterface::getPluginDefinition
PluginBase::getPluginId public function Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.