Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Core/REST/Client/Input/Parser/Version.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\REST\Client\Input\Parser;
8
9 use eZ\Publish\API\Repository\ContentTypeService;
10 use eZ\Publish\Core\REST\Common\Input\BaseParser;
11 use eZ\Publish\Core\REST\Common\Input\ParsingDispatcher;
12 use eZ\Publish\Core\REST\Common\Input\ParserTools;
13 use eZ\Publish\API\Repository\ContentService;
14 use eZ\Publish\Core\REST\Server\Values\Version as VersionValue;
15
19 class Version extends BaseParser
20 {
22 protected $parserTools;
23
29 protected $contentService;
30
32 private $contentTypeService;
33
39 public function __construct(ParserTools $parserTools, ContentService $contentService, ContentTypeService $contentTypeService)
40 {
41 $this->parserTools = $parserTools;
42 $this->contentService = $contentService;
43 $this->contentTypeService = $contentTypeService;
44 }
45
54 public function parse(array $data, ParsingDispatcher $parsingDispatcher)
55 {
56 $contentId = $this->requestParser->parseHref($data['VersionInfo']['Content']['_href'], 'contentId');
57
58 $content = $this->contentService->loadContent($contentId, null, $data['VersionInfo']['versionNo']);
59 $contentType = $this->contentTypeService->loadContentType($content->contentInfo->contentTypeId);
60 $relations = $this->contentService->loadRelations($content->versionInfo);
61
62 return new VersionValue($content, $contentType, $relations);
63 }
64 }
eZ\Publish\Core\REST\Client\Input\Parser\Version
Parser for VersionInfo.
Definition: Core/REST/Client/Input/Parser/Version.php:20
eZ\Publish\Core\REST\Client\Input\Parser\Version\$contentService
$contentService
Definition: Core/REST/Client/Input/Parser/Version.php:29
eZ\Publish\Core\REST\Client\Input\Parser\Version\$contentTypeService
$contentTypeService
Definition: Core/REST/Client/Input/Parser/Version.php:32
eZ\Publish\Core\REST\Client\Input\Parser\Version\__construct
__construct(ParserTools $parserTools, ContentService $contentService, ContentTypeService $contentTypeService)
Definition: Core/REST/Client/Input/Parser/Version.php:39
eZ\Publish\Core\REST\Client\Input\Parser\Version\$parserTools
$parserTools
Definition: Core/REST/Client/Input/Parser/Version.php:22
eZ\Publish\Core\REST\Client\Input\Parser\Version\parse
parse(array $data, ParsingDispatcher $parsingDispatcher)
Parse input structure.
Definition: Core/REST/Client/Input/Parser/Version.php:54
eZ\Publish\Core\REST\Common\Input\BaseParser
Definition: BaseParser.php:12
eZ\Publish\Core\REST\Common\Input\ParserTools
Tools object to be used in Input Parsers.
Definition: ParserTools.php:17
eZ\Publish\Core\REST\Common\Input\ParsingDispatcher
Parsing dispatcher.
Definition: ParsingDispatcher.php:15
eZ\Publish\Core\REST\Server\Values\Version
Version view model.
Definition: Core/REST/Server/Values/Version.php:17
eZ\Publish\API\Repository\ContentService
Definition: API/Repository/ContentService.php:27
eZ\Publish\API\Repository\ContentTypeService
Definition: API/Repository/ContentTypeService.php:25
eZ\Publish\Core\REST\Client\Input\Parser
Definition: Publish/Core/REST/Client/Input/Parser/Content.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.