/** * Parse input structure * * @param array $data * @param \eZ\Publish\Core\REST\Common\Input\ParsingDispatcher $parsingDispatcher * * @return \eZ\Publish\API\Repository\Values\Content\SectionCreateStruct */ public function parse(array $data, ParsingDispatcher $parsingDispatcher) { $sectionCreate = $this->sectionService->newSectionCreateStruct(); //@todo XSD says that name is not mandatory? Does that make sense? if (!array_key_exists('name', $data)) { throw new Exceptions\Parser("Missing 'name' attribute for SectionInput."); } $sectionCreate->name = $data['name']; //@todo XSD says that identifier is not mandatory? Does that make sense? if (!array_key_exists('identifier', $data)) { throw new Exceptions\Parser("Missing 'identifier' attribute for SectionInput."); } $sectionCreate->identifier = $data['identifier']; return $sectionCreate; }
/** * Instantiates a new SectionCreateStruct. * * @return \eZ\Publish\API\Repository\Values\Content\SectionCreateStruct */ public function newSectionCreateStruct() { return $this->service->newSectionCreateStruct(); }