You are here

public function EntityAccessEvent::__construct in Hook Event Dispatcher 8

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 BaseEntityEvent::__construct

File

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

Class

EntityAccessEvent
Class EntityAccessEvent.

Namespace

Drupal\hook_event_dispatcher\Event\Entity

Code

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