function TimeZoneResolver::__construct

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

TimeZoneResolver constructor.

Parameters

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

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

File

core/modules/system/src/TimeZoneResolver.php, line 44

Class

TimeZoneResolver
Event handler that resolves time zone based on site and user configuration.

Namespace

Drupal\system

Code

public function __construct(AccountInterface $current_user, ConfigFactoryInterface $config_factory) {
    $this->configFactory = $config_factory;
    $this->currentUser = $current_user;
}

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