You are here

public function DashboardController::__construct in Opigno dashboard 3.x

DashboardController constructor.

Parameters

\Drupal\opigno_dashboard\BlockServiceInterface $block_service: Opigno dashboard blocks service.

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

\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger service.

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

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

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager service.

File

src/Controller/DashboardController.php, line 62

Class

DashboardController
Controller for all the actions of the Learning Path manager app.

Namespace

Drupal\opigno_dashboard\Controller

Code

public function __construct(BlockServiceInterface $block_service, AccountInterface $account, MessengerInterface $messenger, Connection $database, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager) {
  $this->blockService = $block_service;
  $this->currentUser = $account;
  $this->messenger = $messenger;
  $this->database = $database;
  $this->configFactory = $config_factory;
  try {
    $this->userEntityQuery = $entity_type_manager
      ->getStorage('user')
      ->getQuery();
  } catch (PluginNotFoundException|InvalidPluginDefinitionException $e) {
    watchdog_exception('opigno_dashboard_exception', $e);
  }
}