function MediaRevisionAccessCheck::__construct

Same name in other branches
  1. 8.9.x core/modules/media/src/Access/MediaRevisionAccessCheck.php \Drupal\media\Access\MediaRevisionAccessCheck::__construct()

Constructs a new MediaRevisionAccessCheck.

Parameters

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

File

core/modules/media/src/Access/MediaRevisionAccessCheck.php, line 39

Class

MediaRevisionAccessCheck
Provides an access checker for media item revisions.

Namespace

Drupal\media\Access

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager) {
    @trigger_error('MediaRevisionAccessCheck is deprecated in drupal:9.3.0 and will be removed before drupal:10.0.0. Use "_entity_access" requirement with relevant operation instead. See https://www.drupal.org/node/3161210', E_USER_DEPRECATED);
    $this->mediaStorage = $entity_type_manager->getStorage('media');
    $this->mediaAccess = $entity_type_manager->getAccessControlHandler('media');
}

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