/** * Gets the section parser. * * @return \eZ\Publish\Core\REST\Client\Input\Parser\VersionInfo */ protected function getParser() { $parser = new Input\Parser\VersionInfo(new ParserTools(), $this->getContentServiceMock()); $parser->setRequestParser($this->getRequestParserMock()); return $parser; }
/** * Parse input structure. * * @param array $data * @param \eZ\Publish\Core\REST\Common\Input\ParsingDispatcher $parsingDispatcher * * @todo Error handling * * @return \eZ\Publish\API\Repository\Values\Content\Content */ public function parse(array $data, ParsingDispatcher $parsingDispatcher) { $versionInfo = $this->versionInfoParser->parse($data['VersionInfo'], $parsingDispatcher); $fields = $this->parseFields($data['Fields'], $versionInfo->contentInfoId); return new Values\Content\Content($this->contentService, array('versionInfo' => $versionInfo, 'internalFields' => $fields)); }
/** * Parse input structure. * * @param array $data * @param \eZ\Publish\Core\REST\Common\Input\ParsingDispatcher $parsingDispatcher * * @todo Error handling * * @return \eZ\Publish\API\Repository\Values\Content\Content */ public function parse(array $data, ParsingDispatcher $parsingDispatcher) { $versionInfo = $this->versionInfoParser->parse($data['CurrentVersion']['Version']['VersionInfo'], $parsingDispatcher); $fields = $this->parseFields($data['CurrentVersion']['Version']['Fields'], str_replace('/api/ezp/v2/content/objects/', '', $versionInfo->contentInfoId)); return new Values\Content\Content($this->contentService, array('versionInfo' => $versionInfo, 'internalFields' => $fields)); }