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, Language::ALL);

        return new Values\RestContentType(
            $publishedContentType,
            $publishedContentType->getFieldDefinitions()
        );
    }
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, Language::ALL);

        return new Values\RestContentType(
            $publishedContentType,
            $publishedContentType->getFieldDefinitions()
        );
    }
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 , Language :: ALL ) ; return new Values \ RestContentType ( $ publishedContentType , $ publishedContentType -> getFieldDefinitions ( ) ) ; }
Publishes a content type draft.

@param $contentTypeId

@throws \eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException

@return \eZ\Publish\Core\REST\Server\Values\RestContentType
Publishes a content type draft .