You are here

public function QueryAccessEvent::__construct in Entity API 8

Constructs a new QueryAccessEvent.

Parameters

\Drupal\entity\QueryAccess\ConditionGroup $conditions: The conditions.

string $operation: The operation. Usually one of "view", "update", "duplicate", or "delete".

\Drupal\Core\Session\AccountInterface $account: The user for which to restrict access.

string $entity_type_id: The ID of entity type the query is for.

File

src/QueryAccess/QueryAccessEvent.php, line 59

Class

QueryAccessEvent
Defines the query access event.

Namespace

Drupal\entity\QueryAccess

Code

public function __construct(ConditionGroup $conditions, $operation, AccountInterface $account, $entity_type_id = NULL) {
  $this->conditions = $conditions;
  $this->operation = $operation;
  $this->account = $account;
  if (!isset($entity_type_id)) {
    @trigger_error('The $entity_type_id argument must be passed to QueryAccessEvent::__construct(), it is required before entity:2.0.0. See https://www.drupal.org/node/3134363.', E_USER_DEPRECATED);
  }
  else {
    $this->entityTypeId = $entity_type_id;
  }
}