function NodeAccessControlHandler::__construct

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

Constructs a NodeAccessControlHandler object.

Parameters

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

\Drupal\node\NodeGrantDatabaseStorageInterface $grant_storage: The node grant storage.

\Drupal\Core\Entity\EntityTypeManagerInterface|null $entity_type_manager: The entity type manager.

Overrides EntityAccessControlHandler::__construct

File

core/modules/node/src/NodeAccessControlHandler.php, line 69

Class

NodeAccessControlHandler
Defines the access control handler for the node entity type.

Namespace

Drupal\node

Code

public function __construct(EntityTypeInterface $entity_type, NodeGrantDatabaseStorageInterface $grant_storage, EntityTypeManagerInterface $entity_type_manager = NULL) {
    parent::__construct($entity_type);
    $this->grantStorage = $grant_storage;
    if (!isset($entity_type_manager)) {
        @trigger_error('Calling ' . __METHOD__ . '() without the $entity_type_manager argument is deprecated in drupal:9.3.0 and will be required in drupal:10.0.0. See https://www.drupal.org/node/3214171', E_USER_DEPRECATED);
        $entity_type_manager = \Drupal::entityTypeManager();
    }
    $this->entityTypeManager = $entity_type_manager;
}

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