當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。