You are here

public function ConfigActionsPluginBase::__construct in Config Actions 8

Constructs a new ConfigActionsPlugin object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

ConfigActionsServiceInterface $config_action_service: The ConfigActionsService from the container.

Overrides PluginBase::__construct

File

src/ConfigActionsPluginBase.php, line 137

Class

ConfigActionsPluginBase
Base class for config_actions plugins.

Namespace

Drupal\config_actions

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigActionsServiceInterface $config_action_service) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->actionService = $config_action_service;
  $this->pluginId = $plugin_id;
  $this->allowedOptions = $plugin_definition['options'];
  $this->replace_in = $plugin_definition['replace_in'];
  $this->pluginData = $plugin_definition['data'];
  $this
    ->addAllowed([
    'id' => '',
    'key' => '',
    'source' => '',
    'source_type' => '',
    'dest' => NULL,
    'dest_type' => '',
    'replace' => [],
    'replace_in' => [],
    'base' => '',
    'module' => '',
    'auto' => TRUE,
    'template' => '',
  ]);
  $this
    ->initPlugin($configuration);
}