本文整理匯總了PHP中eZ\Publish\Core\REST\Common\Input\ParserTools::parseStatus方法的典型用法代碼示例。如果您正苦於以下問題:PHP ParserTools::parseStatus方法的具體用法?PHP ParserTools::parseStatus怎麽用?PHP ParserTools::parseStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZ\Publish\Core\REST\Common\Input\ParserTools
的用法示例。
在下文中一共展示了ParserTools::parseStatus方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: parse
/**
* Parse input structure
*
* @param array $data
* @param \eZ\Publish\Core\REST\Common\Input\ParsingDispatcher $parsingDispatcher
*
* @return \eZ\Publish\API\Repository\Values\ContentType\ContentType
* @todo Error handling
* @todo What about missing properties? Set them here, using the service to
* load? Or better set them in the service, since loading is really
* unsuitable here?
*/
public function parse(array $data, ParsingDispatcher $parsingDispatcher)
{
$creatorId = $this->parserTools->parseObjectElement($data['Creator'], $parsingDispatcher);
$modifierId = $this->parserTools->parseObjectElement($data['Modifier'], $parsingDispatcher);
$fieldDefinitionListReference = $this->parserTools->parseObjectElement($data['FieldDefinitions'], $parsingDispatcher);
$contentType = new Values\ContentType\ContentType($this->contentTypeService, array('id' => $data['_href'], 'status' => $this->parserTools->parseStatus($data['status']), 'identifier' => $data['identifier'], 'names' => isset($data['names']) ? $this->parserTools->parseTranslatableList($data['names']) : null, 'descriptions' => isset($data['descriptions']) ? $this->parserTools->parseTranslatableList($data['descriptions']) : null, 'creationDate' => new \DateTime($data['creationDate']), 'modificationDate' => new \DateTime($data['modificationDate']), 'creatorId' => $creatorId, 'modifierId' => $modifierId, 'remoteId' => $data['remoteId'], 'urlAliasSchema' => $data['urlAliasSchema'], 'nameSchema' => $data['nameSchema'], 'isContainer' => $this->parserTools->parseBooleanValue($data['isContainer']), 'mainLanguageCode' => $data['mainLanguageCode'], 'defaultAlwaysAvailable' => $this->parserTools->parseBooleanValue($data['defaultAlwaysAvailable']), 'defaultSortOrder' => $this->parserTools->parseDefaultSortOrder($data['defaultSortOrder']), 'defaultSortField' => $this->parserTools->parseDefaultSortField($data['defaultSortField']), 'fieldDefinitionListReference' => $fieldDefinitionListReference));
if ($contentType->status === Values\ContentType\ContentType::STATUS_DRAFT) {
return new Values\ContentType\ContentTypeDraft($contentType);
}
return $contentType;
}