You are here

public function ImageEffectsPluginBase::__construct in Image Effects 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/ImageEffectsPluginBase.php \Drupal\image_effects\Plugin\ImageEffectsPluginBase::__construct()
  2. 8.2 src/Plugin/ImageEffectsPluginBase.php \Drupal\image_effects\Plugin\ImageEffectsPluginBase::__construct()

Constructs a ImageEffectsPluginBase 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.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The configuration factory.

\Psr\Log\LoggerInterface $logger: The image_effects logger.

Overrides PluginBase::__construct

1 call to ImageEffectsPluginBase::__construct()
Dropdown::__construct in src/Plugin/image_effects/ImageSelector/Dropdown.php
Constructs a ImageEffectsPluginBase object.
1 method overrides ImageEffectsPluginBase::__construct()
Dropdown::__construct in src/Plugin/image_effects/ImageSelector/Dropdown.php
Constructs a ImageEffectsPluginBase object.

File

src/Plugin/ImageEffectsPluginBase.php, line 51

Class

ImageEffectsPluginBase
Base image_effects plugin.

Namespace

Drupal\image_effects\Plugin

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config_factory, LoggerInterface $logger) {
  $this->config = $config_factory
    ->getEditable('image_effects.settings');
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->pluginType = $configuration['plugin_type'];
  $config = $this->config
    ->get($this->pluginType . '.plugin_settings.' . $plugin_id);
  $this
    ->setConfiguration(array_merge($this
    ->defaultConfiguration(), is_array($config) ? $config : []));
  $this->logger = $logger;
}