eZ\Publish\Core\REST\Server\Controller\ContentType::publishContentTypeDraft PHP 메소드

publishContentTypeDraft() 공개 메소드

Publishes a content type draft.
public publishContentTypeDraft ( $contentTypeId ) : RestContentType
$contentTypeId
리턴 eZ\Publish\Core\REST\Server\Values\RestContentType
    public function publishContentTypeDraft($contentTypeId)
    {
        $contentTypeDraft = $this->contentTypeService->loadContentTypeDraft($contentTypeId);
        $fieldDefinitions = $contentTypeDraft->getFieldDefinitions();
        if (empty($fieldDefinitions)) {
            throw new ForbiddenException('Empty content type draft cannot be published');
        }
        $this->contentTypeService->publishContentTypeDraft($contentTypeDraft);
        $publishedContentType = $this->contentTypeService->loadContentType($contentTypeDraft->id);
        return new Values\RestContentType($publishedContentType, $publishedContentType->getFieldDefinitions());
    }