| @@ 38-56 (lines=19) @@ | ||
| 35 | * |
|
| 36 | * @return \eZ\Publish\Core\REST\Server\Values\TemporaryRedirect |
|
| 37 | */ |
|
| 38 | public function redirectContent(Request $request) |
|
| 39 | { |
|
| 40 | if (!$request->query->has('remoteId')) { |
|
| 41 | throw new BadRequestException("'remoteId' parameter is required."); |
|
| 42 | } |
|
| 43 | ||
| 44 | $contentInfo = $this->repository->getContentService()->loadContentInfoByRemoteId( |
|
| 45 | $request->query->get('remoteId') |
|
| 46 | ); |
|
| 47 | ||
| 48 | return new Values\TemporaryRedirect( |
|
| 49 | $this->router->generate( |
|
| 50 | 'ezpublish_rest_loadContent', |
|
| 51 | array( |
|
| 52 | 'contentId' => $contentInfo->id, |
|
| 53 | ) |
|
| 54 | ) |
|
| 55 | ); |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * Loads a content info, potentially with the current version embedded. |
|
| @@ 154-174 (lines=21) @@ | ||
| 151 | * |
|
| 152 | * @return \eZ\Publish\Core\REST\Server\Values\ContentTypeGroupList |
|
| 153 | */ |
|
| 154 | public function loadContentTypeGroupList(Request $request) |
|
| 155 | { |
|
| 156 | if ($request->query->has('identifier')) { |
|
| 157 | $contentTypeGroup = $this->contentTypeService->loadContentTypeGroupByIdentifier( |
|
| 158 | $request->query->get('identifier') |
|
| 159 | ); |
|
| 160 | ||
| 161 | return new Values\TemporaryRedirect( |
|
| 162 | $this->router->generate( |
|
| 163 | 'ezpublish_rest_loadContentTypeGroup', |
|
| 164 | array( |
|
| 165 | 'contentTypeGroupId' => $contentTypeGroup->id, |
|
| 166 | ) |
|
| 167 | ) |
|
| 168 | ); |
|
| 169 | } |
|
| 170 | ||
| 171 | return new Values\ContentTypeGroupList( |
|
| 172 | $this->contentTypeService->loadContentTypeGroups() |
|
| 173 | ); |
|
| 174 | } |
|
| 175 | ||
| 176 | /** |
|
| 177 | * Returns the content type group given by id. |
|