function MaintenanceModeSubscriber::__construct

Same name in this branch
  1. 10 core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php \Drupal\Core\EventSubscriber\MaintenanceModeSubscriber::__construct()
Same name in other branches
  1. 9 core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php \Drupal\user\EventSubscriber\MaintenanceModeSubscriber::__construct()
  2. 9 core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php \Drupal\Core\EventSubscriber\MaintenanceModeSubscriber::__construct()
  3. 8.9.x core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php \Drupal\user\EventSubscriber\MaintenanceModeSubscriber::__construct()
  4. 8.9.x core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php \Drupal\Core\EventSubscriber\MaintenanceModeSubscriber::__construct()
  5. 11.x core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php \Drupal\user\EventSubscriber\MaintenanceModeSubscriber::__construct()
  6. 11.x core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php \Drupal\Core\EventSubscriber\MaintenanceModeSubscriber::__construct()

Constructs a new MaintenanceModeSubscriber.

Parameters

\Drupal\Core\Site\MaintenanceModeInterface $maintenance_mode: The maintenance mode.

\Drupal\Core\Session\AccountInterface $account: The current user.

File

core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php, line 38

Class

MaintenanceModeSubscriber
Maintenance mode subscriber to log out users.

Namespace

Drupal\user\EventSubscriber

Code

public function __construct(MaintenanceModeInterface $maintenance_mode, AccountInterface $account) {
    $this->maintenanceMode = $maintenance_mode;
    $this->account = $account;
}

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