You are here

public function InlineBlock::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Plugin/Block/InlineBlock.php \Drupal\layout_builder\Plugin\Block\InlineBlock::__construct()

Constructs a new InlineBlock.

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\EntityTypeManagerInterface $entity_type_manager: The entity type manager service.

\Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository: The entity display repository.

\Drupal\Core\Session\AccountInterface $current_user: The current user.

Overrides BlockPluginTrait::__construct

File

core/modules/layout_builder/src/Plugin/Block/InlineBlock.php, line 87

Class

InlineBlock
Defines an inline block plugin type.

Namespace

Drupal\layout_builder\Plugin\Block

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, EntityDisplayRepositoryInterface $entity_display_repository, AccountInterface $current_user) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->entityTypeManager = $entity_type_manager;
  $this->entityDisplayRepository = $entity_display_repository;
  $this->currentUser = $current_user;
  if (!empty($this->configuration['block_revision_id']) || !empty($this->configuration['block_serialized'])) {
    $this->isNew = FALSE;
  }
}