eZ\Publish\Core\REST\Server\Controller\ContentType::updateContentTypeDraft PHP Method

updateContentTypeDraft() public method

Updates meta data of a draft. This method does not handle field definitions.
public updateContentTypeDraft ( $contentTypeId, Request $request ) : RestContentType
$contentTypeId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\RestContentType
    public function updateContentTypeDraft($contentTypeId, Request $request)
    {
        $contentTypeDraft = $this->contentTypeService->loadContentTypeDraft($contentTypeId);
        $contentTypeUpdateStruct = $this->inputDispatcher->parse(new Message(array('Content-Type' => $request->headers->get('Content-Type')), $request->getContent()));
        try {
            $this->contentTypeService->updateContentTypeDraft($contentTypeDraft, $contentTypeUpdateStruct);
        } catch (InvalidArgumentException $e) {
            throw new ForbiddenException($e->getMessage());
        }
        return new Values\RestContentType($this->contentTypeService->loadContentTypeDraft($contentTypeDraft->id));
    }