/** * Parse input structure. * * @param array $data * @param \eZ\Publish\Core\REST\Common\Input\ParsingDispatcher $parsingDispatcher * * @return \eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct */ public function parse(array $data, ParsingDispatcher $parsingDispatcher) { $objectStateGroupUpdateStruct = $this->objectStateService->newObjectStateGroupUpdateStruct(); if (array_key_exists('identifier', $data)) { $objectStateGroupUpdateStruct->identifier = $data['identifier']; } if (array_key_exists('defaultLanguageCode', $data)) { $objectStateGroupUpdateStruct->defaultLanguageCode = $data['defaultLanguageCode']; } if (array_key_exists('names', $data)) { if (!is_array($data['names'])) { throw new Exceptions\Parser("Missing or invalid 'names' element for ObjectStateGroupUpdate."); } if (!array_key_exists('value', $data['names']) || !is_array($data['names']['value'])) { throw new Exceptions\Parser("Missing or invalid 'names' element for ObjectStateGroupUpdate."); } $objectStateGroupUpdateStruct->names = $this->parserTools->parseTranslatableList($data['names']); } if (array_key_exists('descriptions', $data) && is_array($data['descriptions'])) { $objectStateGroupUpdateStruct->descriptions = $this->parserTools->parseTranslatableList($data['descriptions']); } return $objectStateGroupUpdateStruct; }
/** * Instantiates a new Object State Group Update Struct. * * @return \eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct */ public function newObjectStateGroupUpdateStruct() { return $this->service->newObjectStateGroupUpdateStruct(); }