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


PHP ContentTypeService::newContentTypeGroupCreateStruct方法代码示例

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


在下文中一共展示了ContentTypeService::newContentTypeGroupCreateStruct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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\ContentTypeGroupCreateStruct
  */
 public function parse(array $data, ParsingDispatcher $parsingDispatcher)
 {
     // Since ContentTypeGroupInput is used both for creating and updating ContentTypeGroup and identifier is not
     // required when updating ContentTypeGroup, we need to rely on PAPI to throw the exception on missing
     // identifier when creating a ContentTypeGroup
     // @todo Bring in line with XSD which says that identifier is required always
     $contentTypeGroupIdentifier = null;
     if (array_key_exists('identifier', $data)) {
         $contentTypeGroupIdentifier = $data['identifier'];
     }
     $contentTypeGroupCreateStruct = $this->contentTypeService->newContentTypeGroupCreateStruct($contentTypeGroupIdentifier);
     if (array_key_exists('modificationDate', $data)) {
         $contentTypeGroupCreateStruct->creationDate = new DateTime($data['modificationDate']);
     }
     // @todo mainLanguageCode, names, descriptions?
     if (array_key_exists('User', $data) && is_array($data['User'])) {
         if (!array_key_exists('_href', $data['User'])) {
             throw new Exceptions\Parser("Missing '_href' attribute for User element in ContentTypeGroupInput.");
         }
         $contentTypeGroupCreateStruct->creatorId = $this->requestParser->parseHref($data['User']['_href'], 'userId');
     }
     return $contentTypeGroupCreateStruct;
 }
开发者ID:dfritschy,项目名称:ezpublish-kernel,代码行数:31,代码来源:ContentTypeGroupInput.php

示例2: newContentTypeGroupCreateStruct

 /**
  * Instantiates a new content type group create class
  *
  * @param string $identifier
  *
  * @return \eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroupCreateStruct
  */
 public function newContentTypeGroupCreateStruct($identifier)
 {
     return $this->service->newContentTypeGroupCreateStruct($identifier);
 }
开发者ID:Jenkosama,项目名称:ezpublish-kernel,代码行数:11,代码来源:ContentTypeService.php


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