You are here

public function ContentHubViewSubscriber::onKernelController in Acquia Content Hub 8

Switch to the render Content Hub user.

Parameters

\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event: The filter controller event.

File

src/EventSubscriber/ContentHubViewSubscriber.php, line 90

Class

ContentHubViewSubscriber
View subscriber rendering main content render arrays into responses.

Namespace

Drupal\acquia_contenthub\EventSubscriber

Code

public function onKernelController(FilterControllerEvent $event) {
  if ($this->routeMatch
    ->getRouteName() === 'acquia_contenthub.content_entity_display.entity') {
    $this->accountSwitcher
      ->switchTo($this->renderAccount);
  }
}