function PluginBase::__construct

Same name in this branch
  1. 8.9.x core/modules/views/src/Plugin/views/PluginBase.php \Drupal\views\Plugin\views\PluginBase::__construct()
Same name and namespace in other branches
  1. 11.x core/modules/views/src/Plugin/views/PluginBase.php \Drupal\views\Plugin\views\PluginBase::__construct()
  2. 11.x core/lib/Drupal/Component/Plugin/PluginBase.php \Drupal\Component\Plugin\PluginBase::__construct()
  3. 10 core/modules/views/src/Plugin/views/PluginBase.php \Drupal\views\Plugin\views\PluginBase::__construct()
  4. 10 core/lib/Drupal/Component/Plugin/PluginBase.php \Drupal\Component\Plugin\PluginBase::__construct()
  5. 9 core/modules/views/src/Plugin/views/PluginBase.php \Drupal\views\Plugin\views\PluginBase::__construct()
  6. 9 core/lib/Drupal/Component/Plugin/PluginBase.php \Drupal\Component\Plugin\PluginBase::__construct()

Constructs a \Drupal\Component\Plugin\PluginBase 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.

9 calls to PluginBase::__construct()
DateField::__construct in core/modules/datetime/src/Plugin/migrate/field/d6/DateField.php
DrupalMedia::__construct in core/modules/media/src/Plugin/CKEditorPlugin/DrupalMedia.php
Constructs a new DrupalMedia plugin object.
DrupalMediaLibrary::__construct in core/modules/media_library/src/Plugin/CKEditorPlugin/DrupalMediaLibrary.php
Constructs a new DrupalMediaLibrary plugin object.
Email::__construct in core/lib/Drupal/Core/Field/Plugin/migrate/field/Email.php
EntityReference::__construct in core/lib/Drupal/Core/Field/Plugin/migrate/field/d7/EntityReference.php

... See full list

7 methods override PluginBase::__construct()
CancelUser::__construct in core/modules/user/src/Plugin/Action/CancelUser.php
Constructs a CancelUser object.
FileProcessBase::__construct in core/modules/migrate/src/Plugin/migrate/process/FileProcessBase.php
Constructs a file process plugin.
JoinPluginBase::__construct in core/modules/views/src/Plugin/views/join/JoinPluginBase.php
Constructs a Drupal\views\Plugin\views\join\JoinPluginBase object.
Migration::__construct in core/modules/migrate/src/Plugin/Migration.php
Constructs a Migration.
Route::__construct in core/modules/migrate/src/Plugin/migrate/process/Route.php
Constructs a \Drupal\Component\Plugin\PluginBase object.

... See full list

File

core/lib/Drupal/Component/Plugin/PluginBase.php, line 53

Class

PluginBase
Base class for plugins wishing to support metadata inspection.

Namespace

Drupal\Component\Plugin

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition) {
  $this->configuration = $configuration;
  $this->pluginId = $plugin_id;
  $this->pluginDefinition = $plugin_definition;
  if ($this instanceof ConfigurablePluginInterface && !$this instanceof ConfigurableInterface) {
    @trigger_error('Drupal\\Component\\Plugin\\ConfigurablePluginInterface is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. You should implement ConfigurableInterface and/or DependentPluginInterface directly as needed. If you implement ConfigurableInterface you may choose to implement ConfigurablePluginInterface in Drupal 8 as well for maximum compatibility, however this must be removed prior to Drupal 9. See https://www.drupal.org/node/2946161', E_USER_DEPRECATED);
  }
}

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