eZ\Publish\Core\Repository\ContentTypeService::loadContentTypeDraft PHP Method

loadContentTypeDraft() public method

Get a Content Type object draft by id.
public loadContentTypeDraft ( mixed $contentTypeId ) : eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft
$contentTypeId mixed
return eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft
    public function loadContentTypeDraft($contentTypeId)
    {
        $spiContentType = $this->contentTypeHandler->load($contentTypeId, SPIContentType::STATUS_DRAFT);
        if ($spiContentType->modifierId != $this->repository->getCurrentUserReference()->getUserId()) {
            throw new NotFoundException('ContentType owned by someone else', $contentTypeId);
        }
        return $this->contentTypeDomainMapper->buildContentTypeDraftDomainObject($spiContentType, array_map(function ($id) {
            return $this->contentTypeHandler->loadGroup($id);
        }, $spiContentType->groupIds));
    }