You are here

public function CampaignMonitorNodeController::__construct in Campaign Monitor 8

Creates an NodeViewController object.

Parameters

\Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager.

\Drupal\Core\Render\RendererInterface $renderer: The renderer service.

\Drupal\Core\Session\AccountInterface $current_user: The current user. For backwards compatibility this is optional, however this will be removed before Drupal 9.0.0.

Overrides EntityViewController::__construct

File

modules/campaignmonitor_campaign/src/Controller/CampaignMonitorNodeController.php, line 35

Class

CampaignMonitorNodeController
Defines a controller to render a single node.

Namespace

Drupal\node\Controller

Code

public function __construct(EntityManagerInterface $entity_manager, RendererInterface $renderer, AccountInterface $current_user = NULL) {
  parent::__construct($entity_manager, $renderer);
  $this->currentUser = $current_user ?: \Drupal::currentUser();
}