You are here

public function EmbedCKEditorPluginBase::__construct in Embed 8

Constructs a Drupal\entity_embed\Plugin\CKEditorPlugin\DrupalEntity 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\Entity\Query\QueryInterface $embed_button_query: The entity query object for embed button.

Overrides PluginBase::__construct

File

src/EmbedCKEditorPluginBase.php, line 37

Class

EmbedCKEditorPluginBase
Provides a base class for embed CKEditor plugins.

Namespace

Drupal\embed

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, QueryInterface $embed_button_query) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->embedButtonQuery = $embed_button_query;
  if (!empty($plugin_definition['embed_type_id'])) {
    $this->embedButtonQuery
      ->condition('type_id', $plugin_definition['embed_type_id']);
  }
}