You are here

public function RedirectHomepageSubscriber::__construct in Open Social 10.2.x

Same name and namespace in other branches
  1. 8.9 modules/custom/alternative_frontpage/src/EventSubscriber/RedirectHomepageSubscriber.php \Drupal\alternative_frontpage\EventSubscriber\RedirectHomepageSubscriber::__construct()
  2. 8 modules/custom/alternative_frontpage/src/EventSubscriber/RedirectHomepageSubscriber.php \Drupal\alternative_frontpage\EventSubscriber\RedirectHomepageSubscriber::__construct()
  3. 8.2 modules/custom/alternative_frontpage/src/EventSubscriber/RedirectHomepageSubscriber.php \Drupal\alternative_frontpage\EventSubscriber\RedirectHomepageSubscriber::__construct()
  4. 8.3 modules/custom/alternative_frontpage/src/EventSubscriber/RedirectHomepageSubscriber.php \Drupal\alternative_frontpage\EventSubscriber\RedirectHomepageSubscriber::__construct()
  5. 8.4 modules/custom/alternative_frontpage/src/EventSubscriber/RedirectHomepageSubscriber.php \Drupal\alternative_frontpage\EventSubscriber\RedirectHomepageSubscriber::__construct()
  6. 8.5 modules/custom/alternative_frontpage/src/EventSubscriber/RedirectHomepageSubscriber.php \Drupal\alternative_frontpage\EventSubscriber\RedirectHomepageSubscriber::__construct()
  7. 8.6 modules/custom/alternative_frontpage/src/EventSubscriber/RedirectHomepageSubscriber.php \Drupal\alternative_frontpage\EventSubscriber\RedirectHomepageSubscriber::__construct()
  8. 8.7 modules/custom/alternative_frontpage/src/EventSubscriber/RedirectHomepageSubscriber.php \Drupal\alternative_frontpage\EventSubscriber\RedirectHomepageSubscriber::__construct()
  9. 8.8 modules/custom/alternative_frontpage/src/EventSubscriber/RedirectHomepageSubscriber.php \Drupal\alternative_frontpage\EventSubscriber\RedirectHomepageSubscriber::__construct()
  10. 10.3.x modules/custom/alternative_frontpage/src/EventSubscriber/RedirectHomepageSubscriber.php \Drupal\alternative_frontpage\EventSubscriber\RedirectHomepageSubscriber::__construct()
  11. 10.0.x modules/custom/alternative_frontpage/src/EventSubscriber/RedirectHomepageSubscriber.php \Drupal\alternative_frontpage\EventSubscriber\RedirectHomepageSubscriber::__construct()
  12. 10.1.x modules/custom/alternative_frontpage/src/EventSubscriber/RedirectHomepageSubscriber.php \Drupal\alternative_frontpage\EventSubscriber\RedirectHomepageSubscriber::__construct()

Constructor for the RedirectHomepageSubscriber.

Parameters

\Drupal\user\UserData $user_data: User data.

\Drupal\Core\Config\ConfigFactory $config_factory: Config factory.

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

\Drupal\Core\Path\PathMatcher $path_matcher: The path matcher.

\Drupal\Core\State\State $state: The state.

File

modules/custom/alternative_frontpage/src/EventSubscriber/RedirectHomepageSubscriber.php, line 78

Class

RedirectHomepageSubscriber
Class RedirectHomepageSubscriber.

Namespace

Drupal\alternative_frontpage\EventSubscriber

Code

public function __construct(UserData $user_data, ConfigFactory $config_factory, AccountProxy $current_user, PathMatcher $path_matcher, State $state) {

  // We needs it.
  $this->userData = $user_data;
  $this->alternativeFrontpageSettings = $config_factory
    ->get('alternative_frontpage.settings');
  $this->siteSettings = $config_factory
    ->get('system.site');
  $this->currentUser = $current_user;
  $this->pathMatcher = $path_matcher;
  $this->state = $state;
}