function BlockForm::__construct

Same name in other branches
  1. 9 core/modules/block/src/BlockForm.php \Drupal\block\BlockForm::__construct()
  2. 8.9.x core/modules/block/src/BlockForm.php \Drupal\block\BlockForm::__construct()
  3. 11.x core/modules/block/src/BlockForm.php \Drupal\block\BlockForm::__construct()

Constructs a BlockForm object.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\Executable\ExecutableManagerInterface $manager: The ConditionManager for building the visibility UI.

\Drupal\Core\Plugin\Context\ContextRepositoryInterface $context_repository: The lazy context repository service.

\Drupal\Core\Language\LanguageManagerInterface $language: The language manager.

\Drupal\Core\Extension\ThemeHandlerInterface $theme_handler: The theme handler.

\Drupal\Core\Plugin\PluginFormFactoryInterface $plugin_form_manager: The plugin form manager.

\Drupal\block\BlockRepositoryInterface|null $block_repository: The block repository service.

File

core/modules/block/src/BlockForm.php, line 101

Class

BlockForm
Provides form for block instance forms.

Namespace

Drupal\block

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, ExecutableManagerInterface $manager, ContextRepositoryInterface $context_repository, LanguageManagerInterface $language, ThemeHandlerInterface $theme_handler, PluginFormFactoryInterface $plugin_form_manager, ?BlockRepositoryInterface $block_repository = NULL) {
    if ($block_repository === NULL) {
        @trigger_error('Calling ' . __METHOD__ . ' without the $block_repository argument is deprecated in drupal:10.2.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3333575', E_USER_DEPRECATED);
        $block_repository = \Drupal::service('block.repository');
    }
    $this->storage = $entity_type_manager->getStorage('block');
    $this->manager = $manager;
    $this->contextRepository = $context_repository;
    $this->language = $language;
    $this->themeHandler = $theme_handler;
    $this->pluginFormFactory = $plugin_form_manager;
    $this->blockRepository = $block_repository;
}

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