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()); }