protected function injectSiteApiValueObjects(Request $request, $language)
    {
        /** @var \eZ\Publish\API\Repository\Values\Content\Content $content */
        /** @var \eZ\Publish\API\Repository\Values\Content\Location $location */
        $content = $request->attributes->get('content');
        $location = $request->attributes->get('location');

        $siteContent = $this->loadService->loadContent(
            $content->id,
            $content->versionInfo->versionNo,
            $language
        );

        if (!$location->isDraft()) {
            $siteLocation = $this->loadService->loadLocation($location->id);
        } else {
            $siteLocation = new SiteLocation([
                'contentInfo' => $siteContent->contentInfo,
                'innerLocation' => $location,
            ]);
        }

        $requestParams = $request->attributes->get('params');
        $requestParams['content'] = $siteContent;
        $requestParams['location'] = $siteLocation;

        $request->attributes->set('content', $siteContent);
        $request->attributes->set('location', $siteLocation);
        $request->attributes->set('params', $requestParams);
    }
protected function injectSiteApiValueObjects(Request $request, $language)
    {
        /** @var \eZ\Publish\API\Repository\Values\Content\Content $content */
        /** @var \eZ\Publish\API\Repository\Values\Content\Location $location */
        $content = $request->attributes->get('content');
        $location = $request->attributes->get('location');

        $siteContent = $this->loadService->loadContent(
            $content->id,
            $content->versionInfo->versionNo,
            $language
        );

        if (!$location->isDraft()) {
            $siteLocation = $this->loadService->loadLocation($location->id);
        } else {
            $siteLocation = new SiteLocation([
                'contentInfo' => $siteContent->contentInfo,
                'innerLocation' => $location,
            ]);
        }

        $requestParams = $request->attributes->get('params');
        $requestParams['content'] = $siteContent;
        $requestParams['location'] = $siteLocation;

        $request->attributes->set('content', $siteContent);
        $request->attributes->set('location', $siteLocation);
        $request->attributes->set('params', $requestParams);
    }
protected function injectSiteApiValueObjects ( Request $ request , $ language ) { /** @var \eZ\Publish\API\Repository\Values\Content\Content $content */ /** @var \eZ\Publish\API\Repository\Values\Content\Location $location */ $ content = $ request -> attributes -> get ( 'content' ) ; $ location = $ request -> attributes -> get ( 'location' ) ; $ siteContent = $ this -> loadService -> loadContent ( $ content -> id , $ content -> versionInfo -> versionNo , $ language ) ; if ( ! $ location -> isDraft ( ) ) { $ siteLocation = $ this -> loadService -> loadLocation ( $ location -> id ) ; } else { $ siteLocation = new SiteLocation ( [ 'contentInfo' => $ siteContent -> contentInfo , 'innerLocation' => $ location , ] ) ; } $ requestParams = $ request -> attributes -> get ( 'params' ) ; $ requestParams [ 'content' ] = $ siteContent ; $ requestParams [ 'location' ] = $ siteLocation ; $ request -> attributes -> set ( 'content' , $ siteContent ) ; $ request -> attributes -> set ( 'location' , $ siteLocation ) ; $ request -> attributes -> set ( 'params' , $ requestParams ) ; }
Injects the Site API value objects into request, replacing the original
eZ API value objects.

@throws \Netgen\EzPlatformSiteApi\API\Exceptions\TranslationNotMatchedException

@param \Symfony\Component\HttpFoundation\Request $request
@param string $language
Injects the Site API value objects into request replacing the original eZ API value objects .