protected function getForwardRequest(Location $location, Content $content, SiteAccess $previewSiteAccess, Request $request, $language)
    {
        $forwardRequestParameters = array(
            '_controller' => UrlAliasRouter::VIEW_ACTION,
            // specify a route for RouteReference generator
            '_route' => UrlAliasGenerator::INTERNAL_CONTENT_VIEW_ROUTE,
            '_route_params' => array(
                'contentId' => $content->id,
                'locationId' => $location->id,
            ),
            'location' => $location,
            'content' => $content,
            'viewType' => ViewManagerInterface::VIEW_TYPE_FULL,
            'layout' => true,
            'params' => array(
                'content' => $content,
                'location' => $location,
                'isPreview' => true,
                'language' => $language,
            ),
            'siteaccess' => $previewSiteAccess,
            'semanticPathinfo' => $request->attributes->get('semanticPathinfo'),
        );

        if ($this->controllerChecker->usesCustomController($content, $location)) {
            $forwardRequestParameters = [
                '_controller' => 'ez_content:viewLocation',
                '_route' => self::INTERNAL_LOCATION_VIEW_ROUTE,
            ] + $forwardRequestParameters;
        }

        return $request->duplicate(
            null,
            null,
            $forwardRequestParameters
        );
    }
protected function getForwardRequest(Location $location, Content $content, SiteAccess $previewSiteAccess, Request $request, $language)
    {
        $forwardRequestParameters = array(
            '_controller' => UrlAliasRouter::VIEW_ACTION,
            // specify a route for RouteReference generator
            '_route' => UrlAliasGenerator::INTERNAL_CONTENT_VIEW_ROUTE,
            '_route_params' => array(
                'contentId' => $content->id,
                'locationId' => $location->id,
            ),
            'location' => $location,
            'content' => $content,
            'viewType' => ViewManagerInterface::VIEW_TYPE_FULL,
            'layout' => true,
            'params' => array(
                'content' => $content,
                'location' => $location,
                'isPreview' => true,
                'language' => $language,
            ),
            'siteaccess' => $previewSiteAccess,
            'semanticPathinfo' => $request->attributes->get('semanticPathinfo'),
        );

        if ($this->controllerChecker->usesCustomController($content, $location)) {
            $forwardRequestParameters = [
                '_controller' => 'ez_content:viewLocation',
                '_route' => self::INTERNAL_LOCATION_VIEW_ROUTE,
            ] + $forwardRequestParameters;
        }

        return $request->duplicate(
            null,
            null,
            $forwardRequestParameters
        );
    }
protected function getForwardRequest ( Location $ location , Content $ content , SiteAccess $ previewSiteAccess , Request $ request , $ language ) { $ forwardRequestParameters = array ( '_controller' => UrlAliasRouter :: VIEW_ACTION , // specify a route for RouteReference generator '_route' => UrlAliasGenerator :: INTERNAL_CONTENT_VIEW_ROUTE , '_route_params' => array ( 'contentId' => $ content -> id , 'locationId' => $ location -> id , ) , 'location' => $ location , 'content' => $ content , 'viewType' => ViewManagerInterface :: VIEW_TYPE_FULL , 'layout' => true , 'params' => array ( 'content' => $ content , 'location' => $ location , 'isPreview' => true , 'language' => $ language , ) , 'siteaccess' => $ previewSiteAccess , 'semanticPathinfo' => $ request -> attributes -> get ( 'semanticPathinfo' ) , ) ; if ( $ this -> controllerChecker -> usesCustomController ( $ content , $ location ) ) { $ forwardRequestParameters = [ '_controller' => 'ez_content:viewLocation' , '_route' => self :: INTERNAL_LOCATION_VIEW_ROUTE , ] + $ forwardRequestParameters ; } return $ request -> duplicate ( null , null , $ forwardRequestParameters ) ; }
Returns the Request object that will be forwarded to the kernel for previewing the content.

@param \eZ\Publish\API\Repository\Values\Content\Location $location
@param \eZ\Publish\API\Repository\Values\Content\Content $content
@param \eZ\Publish\Core\MVC\Symfony\SiteAccess $previewSiteAccess
@param Request $request
@param string $language

@return \Symfony\Component\HttpFoundation\Request
Returns the Request object that will be forwarded to the kernel for previewing the content .