You are here

public function EntityAccessEvent::__construct in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/core_event_dispatcher/src/Event/Entity/EntityAccessEvent.php \Drupal\core_event_dispatcher\Event\Entity\EntityAccessEvent::__construct()

EntityAccessEvent constructor.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to check access to.

string $operation: The operation that is to be performed on $entity.

\Drupal\Core\Session\AccountInterface $account: The account trying to access the entity.

Overrides AbstractEntityEvent::__construct

File

modules/core_event_dispatcher/src/Event/Entity/EntityAccessEvent.php, line 45

Class

EntityAccessEvent
Class EntityAccessEvent.

Namespace

Drupal\core_event_dispatcher\Event\Entity

Code

public function __construct(EntityInterface $entity, string $operation, AccountInterface $account) {
  parent::__construct($entity);
  $this->operation = $operation;
  $this->account = $account;
  $this->accessResult = new AccessResultNeutral();
}