function BlockAccessControlHandler::__construct

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

Constructs the block access control handler instance.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition.

\Drupal\Core\Plugin\Context\ContextHandlerInterface $context_handler: The ContextHandler for applying contexts to conditions properly.

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

Overrides EntityAccessControlHandler::__construct

File

core/modules/block/src/BlockAccessControlHandler.php, line 65

Class

BlockAccessControlHandler
Defines the access control handler for the block entity type.

Namespace

Drupal\block

Code

public function __construct(EntityTypeInterface $entity_type, ContextHandlerInterface $context_handler, ContextRepositoryInterface $context_repository) {
    parent::__construct($entity_type);
    $this->contextHandler = $context_handler;
    $this->contextRepository = $context_repository;
}

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