You are here

public function EventController::__construct in MongoDB 8.2

EventController constructor.

Parameters

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

\Drupal\Core\Datetime\DateFormatterInterface $dateFormatter: The core data.formatter service.

\Drupal\mongodb_watchdog\Logger $watchdog: The MongoDB logger service, to load events.

File

modules/mongodb_watchdog/src/EventController.php, line 76

Class

EventController
Class EventController provides query and render logic for Event occurrences.

Namespace

Drupal\mongodb_watchdog

Code

public function __construct(ConfigFactoryInterface $config, DateFormatterInterface $dateFormatter, Logger $watchdog) {

  // Needed for other values so build it first.
  $this->front = Url::fromRoute('<front>', [], [
    'absolute' => TRUE,
  ])
    ->toString();
  $this->anonymous = $config
    ->get('user.settings')
    ->get('anonymous');
  $this->baseLength = mb_strlen($this->front) - 1;
  $this->dateFormatter = $dateFormatter;
  $this->watchdog = $watchdog;
}