You are here

public function PurgerBase::__construct in Purge 8.3

Construct a PurgerBase derivative.

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.

Throws

\LogicException Thrown if $configuration['id'] is missing, see Purger\Service::createId.

Overrides PluginBase::__construct

File

src/Plugin/Purge/Purger/PurgerBase.php, line 42

Class

PurgerBase
Provides a base class for all purgers - the cache invalidation executors.

Namespace

Drupal\purge\Plugin\Purge\Purger

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition) {
  if (!is_string($configuration['id']) || empty($configuration['id'])) {
    throw new \LogicException('Purger cannot be constructed without ID.');
  }
  $this->id = $configuration['id'];
  unset($configuration['id']);
  parent::__construct($configuration, $plugin_id, $plugin_definition);
}