当前位置: 首页>>代码示例>>PHP>>正文


PHP ParserTools::parseObjectElement方法代码示例

本文整理汇总了PHP中eZ\Publish\Core\REST\Common\Input\ParserTools::parseObjectElement方法的典型用法代码示例。如果您正苦于以下问题:PHP ParserTools::parseObjectElement方法的具体用法?PHP ParserTools::parseObjectElement怎么用?PHP ParserTools::parseObjectElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZ\Publish\Core\REST\Common\Input\ParserTools的用法示例。


在下文中一共展示了ParserTools::parseObjectElement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parse

 /**
  * Parse input structure
  *
  * @param array $data
  * @param \eZ\Publish\Core\REST\Common\Input\ParsingDispatcher $parsingDispatcher
  *
  * @return \eZ\Publish\Core\REST\Client\Values\FieldDefinitionList
  */
 public function parse(array $data, ParsingDispatcher $parsingDispatcher)
 {
     $fieldDefinitionReferences = array();
     foreach ($data['FieldDefinition'] as $fieldDefinitionData) {
         $fieldDefinitionReferences[] = $this->parserTools->parseObjectElement($fieldDefinitionData, $parsingDispatcher);
     }
     return new Values\FieldDefinitionList($this->contentTypeService, $fieldDefinitionReferences);
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:16,代码来源:FieldDefinitionList.php

示例2: 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;
 }
开发者ID:dfritschy,项目名称:ezpublish-kernel,代码行数:23,代码来源:ContentType.php

示例3: parse

 /**
  * Parse input structure
  *
  * @param array $data
  * @param \eZ\Publish\Core\REST\Common\Input\ParsingDispatcher $parsingDispatcher
  *
  * @return \eZ\Publish\API\Repository\Values\Content\ContentInfo
  * @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)
 {
     $contentTypeId = $this->parserTools->parseObjectElement($data['ContentType'], $parsingDispatcher);
     $ownerId = $this->parserTools->parseObjectElement($data['Owner'], $parsingDispatcher);
     $mainLocationId = $this->parserTools->parseObjectElement($data['MainLocation'], $parsingDispatcher);
     $sectionId = $this->parserTools->parseObjectElement($data['Section'], $parsingDispatcher);
     $locationListReference = $this->parserTools->parseObjectElement($data['Locations'], $parsingDispatcher);
     $versionListReference = $this->parserTools->parseObjectElement($data['Versions'], $parsingDispatcher);
     $currentVersionReference = $this->parserTools->parseObjectElement($data['CurrentVersion'], $parsingDispatcher);
     if (isset($data['CurrentVersion']['Version'])) {
         $this->parserTools->parseObjectElement($data['CurrentVersion']['Version'], $parsingDispatcher);
     }
     return new Values\RestContentInfo(array('id' => $data['_href'], 'name' => $data['Name'], 'contentTypeId' => $contentTypeId, 'ownerId' => $ownerId, 'modificationDate' => new \DateTime($data['lastModificationDate']), 'publishedDate' => $publishedDate = !empty($data['publishedDate']) ? new \DateTime($data['publishedDate']) : null, 'published' => $publishedDate !== null, 'alwaysAvailable' => strtolower($data['alwaysAvailable']) === 'true', 'remoteId' => $data['_remoteId'], 'mainLanguageCode' => $data['mainLanguageCode'], 'mainLocationId' => $mainLocationId, 'sectionId' => $sectionId, 'versionListReference' => $versionListReference, 'locationListReference' => $locationListReference, 'currentVersionReference' => $currentVersionReference));
 }
开发者ID:CG77,项目名称:ezpublish-kernel,代码行数:26,代码来源:ContentInfo.php

示例4: parse

 /**
  * 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\Section
  */
 public function parse(array $data, ParsingDispatcher $parsingDispatcher)
 {
     $creatorId = $this->parserTools->parseObjectElement($data['Creator'], $parsingDispatcher);
     $modifierId = $this->parserTools->parseObjectElement($data['Modifier'], $parsingDispatcher);
     return new Values\ContentType\ContentTypeGroup(array('id' => $data['_href'], 'identifier' => $data['identifier'], 'creationDate' => new \DateTime($data['created']), 'modificationDate' => new \DateTime($data['modified']), 'creatorId' => $creatorId, 'modifierId' => $modifierId));
 }
开发者ID:ezsystems,项目名称:ezpublish-kernel,代码行数:16,代码来源:ContentTypeGroup.php

示例5: parse

 /**
  * 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\VersionInfo
  */
 public function parse(array $data, ParsingDispatcher $parsingDispatcher)
 {
     $contentInfoId = $this->parserTools->parseObjectElement($data['Content'], $parsingDispatcher);
     return new Values\Content\VersionInfo($this->contentService, array('id' => $data['id'], 'versionNo' => $data['versionNo'], 'status' => $this->convertVersionStatus($data['status']), 'modificationDate' => new \DateTime($data['modificationDate']), 'creatorId' => $data['Creator']['_href'], 'creationDate' => new \DateTime($data['creationDate']), 'initialLanguageCode' => $data['initialLanguageCode'], 'languageCodes' => explode(',', $data['languageCodes']), 'names' => $this->parserTools->parseTranslatableList($data['names']), 'contentInfoId' => $contentInfoId));
 }
开发者ID:CG77,项目名称:ezpublish-kernel,代码行数:15,代码来源:VersionInfo.php


注:本文中的eZ\Publish\Core\REST\Common\Input\ParserTools::parseObjectElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。