function NodeRevisionDeleteForm::__construct

Same name in other branches
  1. 9 core/modules/node/src/Form/NodeRevisionDeleteForm.php \Drupal\node\Form\NodeRevisionDeleteForm::__construct()
  2. 8.9.x core/modules/node/src/Form/NodeRevisionDeleteForm.php \Drupal\node\Form\NodeRevisionDeleteForm::__construct()
  3. 11.x core/modules/node/src/Form/NodeRevisionDeleteForm.php \Drupal\node\Form\NodeRevisionDeleteForm::__construct()

Constructs a new NodeRevisionDeleteForm.

Parameters

\Drupal\Core\Entity\EntityStorageInterface $node_storage: The node storage.

\Drupal\Core\Entity\EntityStorageInterface $node_type_storage: The node type storage.

\Drupal\Core\Access\AccessManagerInterface|\Drupal\Core\Database\Connection $access_manager: The access manager.

\Drupal\Core\Datetime\DateFormatterInterface $date_formatter: The date formatter service.

File

core/modules/node/src/Form/NodeRevisionDeleteForm.php, line 76

Class

NodeRevisionDeleteForm
Provides a form for deleting a node revision.

Namespace

Drupal\node\Form

Code

public function __construct(EntityStorageInterface $node_storage, EntityStorageInterface $node_type_storage, AccessManagerInterface|Connection $access_manager, DateFormatterInterface $date_formatter) {
    $this->nodeStorage = $node_storage;
    $this->nodeTypeStorage = $node_type_storage;
    $this->accessManager = $access_manager;
    $this->dateFormatter = $date_formatter;
    if ($access_manager instanceof Connection) {
        $this->connection = $access_manager;
        $this->accessManager = func_get_arg(3);
        @trigger_error('Calling ' . __CLASS__ . '::_construct() with the $connection argument is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3343754', E_USER_DEPRECATED);
    }
}

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