getForwardRequest() protected method

Returns the Request object that will be forwarded to the kernel for previewing the content.
protected getForwardRequest ( eZ\Publish\API\Repository\Values\Content\Location $location, eZ\Publish\API\Repository\Values\Content\Content $content, SiteAccess $previewSiteAccess, Request $request, string $language ) : Request
$location eZ\Publish\API\Repository\Values\Content\Location
$content eZ\Publish\API\Repository\Values\Content\Content
$previewSiteAccess eZ\Publish\Core\MVC\Symfony\SiteAccess
$request Symfony\Component\HttpFoundation\Request
$language string
return Symfony\Component\HttpFoundation\Request
 protected function getForwardRequest(Location $location, Content $content, SiteAccess $previewSiteAccess)
 {
     $request = parent::getForwardRequest($location, $content, $previewSiteAccess);
     // If the preview siteaccess is configured in legacy_mode, we forward to the LegacyKernelController.
     if ($this->configResolver->getParameter('legacy_mode', 'ezsettings', $previewSiteAccess->name)) {
         $request->attributes->set('_controller', 'ezpublish_legacy.controller:indexAction');
     }
     return $request;
 }
 protected function getForwardRequest(Location $location, Content $content, SiteAccess $previewSiteAccess, Request $request, $language)
 {
     $request = parent::getForwardRequest($location, $content, $previewSiteAccess, $request, $language);
     $overrideViewAction = $this->configResolver->getParameter('override_url_alias_view_action', 'netgen_ez_platform_site_api');
     // If the preview siteaccess is configured in legacy_mode
     // we forward to the LegacyKernelController.
     // For compatibility with eZ Publish Legacy
     if ($this->isLegacyModeSiteAccess($previewSiteAccess->name)) {
         $request->attributes->set('_controller', 'ezpublish_legacy.controller:indexAction');
     } elseif ($overrideViewAction) {
         $request->attributes->set('_controller', UrlAliasRouter::OVERRIDE_VIEW_ACTION);
         $this->injectSiteApiValueObjects($request, $language);
     }
     return $request;
 }