| @@ 64-82 (lines=19) @@ | ||
| 61 | */ |
|
| 62 | public function render($uri, Request $request, array $options = []) |
|
| 63 | { |
|
| 64 | if ($uri instanceof ControllerReference && $request->attributes->has('siteaccess')) { |
|
| 65 | // Serialize the siteaccess to get it back after. |
|
| 66 | // @see eZ\Publish\Core\MVC\Symfony\EventListener\SiteAccessMatchListener |
|
| 67 | $siteAccess = $request->attributes->get('siteaccess'); |
|
| 68 | $uri->attributes['serialized_siteaccess'] = json_encode($siteAccess); |
|
| 69 | $uri->attributes['serialized_siteaccess_matcher'] = $this->getSerializer()->serialize( |
|
| 70 | $siteAccess->matcher, |
|
| 71 | 'json' |
|
| 72 | ); |
|
| 73 | if ($siteAccess->matcher instanceof SiteAccess\Matcher\CompoundInterface) { |
|
| 74 | $subMatchers = $siteAccess->matcher->getSubMatchers() ?? null; |
|
| 75 | foreach ($subMatchers as $subMatcher) { |
|
| 76 | $uri->attributes['serialized_siteaccess_sub_matchers'][get_class($subMatcher)] = $this->getSerializer()->serialize( |
|
| 77 | $subMatcher, |
|
| 78 | 'json' |
|
| 79 | ); |
|
| 80 | } |
|
| 81 | } |
|
| 82 | } |
|
| 83 | ||
| 84 | return $this->innerRenderer->render($uri, $request, $options); |
|
| 85 | } |
|
| @@ 48-65 (lines=18) @@ | ||
| 45 | public function render($uri, Request $request, array $options = []) |
|
| 46 | { |
|
| 47 | if ($uri instanceof ControllerReference) { |
|
| 48 | if ($request->attributes->has('siteaccess')) { |
|
| 49 | /** @var \eZ\Publish\Core\MVC\Symfony\SiteAccess $siteAccess */ |
|
| 50 | $siteAccess = $request->attributes->get('siteaccess'); |
|
| 51 | $uri->attributes['serialized_siteaccess'] = json_encode($siteAccess); |
|
| 52 | $uri->attributes['serialized_siteaccess_matcher'] = $this->getSerializer()->serialize( |
|
| 53 | $siteAccess->matcher, |
|
| 54 | 'json' |
|
| 55 | ); |
|
| 56 | if ($siteAccess->matcher instanceof SiteAccess\Matcher\CompoundInterface) { |
|
| 57 | $subMatchers = $siteAccess->matcher->getSubMatchers() ?? null; |
|
| 58 | foreach ($subMatchers as $subMatcher) { |
|
| 59 | $uri->attributes['serialized_siteaccess_sub_matchers'][get_class($subMatcher)] = $this->getSerializer()->serialize( |
|
| 60 | $subMatcher, |
|
| 61 | 'json' |
|
| 62 | ); |
|
| 63 | } |
|
| 64 | } |
|
| 65 | } |
|
| 66 | if ($request->attributes->has('semanticPathinfo')) { |
|
| 67 | $uri->attributes['semanticPathinfo'] = $request->attributes->get('semanticPathinfo'); |
|
| 68 | } |
|