You are here

public function ComponentBlock::__construct in Component blocks 1.1.x

Same name and namespace in other branches
  1. 1.x src/Plugin/Block/ComponentBlock.php \Drupal\component_blocks\Plugin\Block\ComponentBlock::__construct()
  2. 1.0.x src/Plugin/Block/ComponentBlock.php \Drupal\component_blocks\Plugin\Block\ComponentBlock::__construct()

Constructs a new ComponentBlock.

Parameters

array $configuration: Configuration.

string $plugin_id: Plugin Id.

array $plugin_definition: Plugin definition.

\Drupal\ui_patterns\UiPatternsManager $uiPatternsManager: Plugin manager.

\Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager: Entity type manager.

\Drupal\Core\Plugin\Context\ContextHandlerInterface $contextHandler: Context handler.

\Drupal\Core\Field\FormatterPluginManager $formatterPluginManager: Formatter manager.

\Drupal\Core\Utility\Token $token: Token service.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: Module handler.

Overrides BlockPluginTrait::__construct

File

src/Plugin/Block/ComponentBlock.php, line 110

Class

ComponentBlock
Defines a class for a specially shaped block.

Namespace

Drupal\component_blocks\Plugin\Block

Code

public function __construct(array $configuration, $plugin_id, array $plugin_definition, UiPatternsManager $uiPatternsManager, EntityTypeManagerInterface $entityTypeManager, ContextHandlerInterface $contextHandler, FormatterPluginManager $formatterPluginManager, Token $token, ModuleHandlerInterface $module_handler) {
  $this->uiPatternsManager = $uiPatternsManager;
  $this->entityTypeManager = $entityTypeManager;
  $this->contextHandler = $contextHandler;
  $this->formatterPluginManager = $formatterPluginManager;
  $this->token = $token;
  $this->moduleHandler = $module_handler;

  // This has to be last because the parent constructor calls
  // ::setConfiguration.
  parent::__construct($configuration, $plugin_id, $plugin_definition);
}