public function BlockRepository::__construct in Drupal 9
Same name and namespace in other branches
- 8 core/modules/block/src/BlockRepository.php \Drupal\block\BlockRepository::__construct()
Constructs a new BlockRepository.
Parameters
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager service.
\Drupal\Core\Theme\ThemeManagerInterface $theme_manager: The theme manager.
\Drupal\Core\Plugin\Context\ContextHandlerInterface $context_handler: The plugin context handler.
File
- core/
modules/ block/ src/ BlockRepository.php, line 39
Class
- BlockRepository
- Provides a repository for Block config entities.
Namespace
Drupal\blockCode
public function __construct(EntityTypeManagerInterface $entity_type_manager, ThemeManagerInterface $theme_manager, ContextHandlerInterface $context_handler) {
$this->blockStorage = $entity_type_manager
->getStorage('block');
$this->themeManager = $theme_manager;
$this->contextHandler = $context_handler;
}