You are here

public function ConfigEntityRevisionsDeleteFormBase::__construct in Config Entity Revisions 1.x

Same name and namespace in other branches
  1. 8.2 src/ConfigEntityRevisionsDeleteFormBase.php \Drupal\config_entity_revisions\ConfigEntityRevisionsDeleteFormBase::__construct()
  2. 8 src/ConfigEntityRevisionsDeleteFormBase.php \Drupal\config_entity_revisions\ConfigEntityRevisionsDeleteFormBase::__construct()

Constructs a new ConfigEntityRevisionsRevisionDeleteForm.

Parameters

EntityStorageInterface $storage: The ConfigEntityRevisions storage.

Connection $connection: The database connection.

DateFormatter $dateFormatter: The date formatter service.

ConfigEntityRevisionsControllerInterface: The controller interface.

File

src/ConfigEntityRevisionsDeleteFormBase.php, line 75

Class

ConfigEntityRevisionsDeleteFormBase
Provides a form for reverting a config entity revision.

Namespace

Drupal\config_entity_revisions

Code

public function __construct(EntityStorageInterface $storage, Connection $connection, $dateFormatter, ConfigEntityRevisionsControllerInterface $controller) {
  $this->connection = $connection;
  $this->dateFormatter = $dateFormatter;
  $match = \Drupal::service('router')
    ->matchRequest(\Drupal::request());
  $this->config_entity = $match['config_entity']
    ->revisioned_entity();
  $this->configEntityRevisionsStorage = $storage;
  $this->revision = $storage
    ->loadRevision($match['revision_id']);
  $this->controller = $controller;
}