You are here

public function ConfigEntityRevisionsDeleteFormBase::__construct in Config Entity Revisions 8.2

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

Constructs a new ConfigEntityRevisionsRevisionDeleteForm.

Parameters

\Drupal\Core\Entity\EntityStorageInterface $storage: The ConfigEntityRevisions storage.

\Drupal\Core\Database\Connection $connection: The database connection.

\Drupal\Core\Datetime\DateFormatter $dateFormatter: The date formatter service.

\Drupal\config_entity_revisions\ConfigEntityRevisionsControllerInterface $controller: The controller interface.

File

src/ConfigEntityRevisionsDeleteFormBase.php, line 72

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 $dateFormatter, ConfigEntityRevisionsControllerInterface $controller) {
  $this->connection = $connection;
  $this->dateFormatter = $dateFormatter;
  $match = \Drupal::service('router')
    ->matchRequest(\Drupal::request());
  $this->config_entity = $match['config_entity']
    ->revisionedEntity();
  $this->configEntityRevisionsRevisionStorageHandler = $storage;
  $this->revision = $storage
    ->loadRevision($match['revision_id']);
  $this->controller = $controller;
}