public function createDraftFromVersion($contentId, $versionNumber)
    {
        $contentInfo = $this->repository->getContentService()->loadContentInfo($contentId);
        $contentType = $this->repository->getContentTypeService()->loadContentType($contentInfo->contentTypeId);
        $contentDraft = $this->repository->getContentService()->createContentDraft(
            $contentInfo,
            $this->repository->getContentService()->loadVersionInfo($contentInfo, $versionNumber)
        );

        return new Values\CreatedVersion(
            array(
                'version' => new Values\Version(
                    $contentDraft,
                    $contentType,
                    $this->repository->getContentService()->loadRelations($contentDraft->getVersionInfo())
                ),
            )
        );
    }
public function createDraftFromVersion($contentId, $versionNumber)
    {
        $contentInfo = $this->repository->getContentService()->loadContentInfo($contentId);
        $contentType = $this->repository->getContentTypeService()->loadContentType($contentInfo->contentTypeId);
        $contentDraft = $this->repository->getContentService()->createContentDraft(
            $contentInfo,
            $this->repository->getContentService()->loadVersionInfo($contentInfo, $versionNumber)
        );

        return new Values\CreatedVersion(
            array(
                'version' => new Values\Version(
                    $contentDraft,
                    $contentType,
                    $this->repository->getContentService()->loadRelations($contentDraft->getVersionInfo())
                ),
            )
        );
    }
public function createDraftFromVersion ( $ contentId , $ versionNumber ) { $ contentInfo = $ this -> repository -> getContentService ( ) -> loadContentInfo ( $ contentId ) ; $ contentType = $ this -> repository -> getContentTypeService ( ) -> loadContentType ( $ contentInfo -> contentTypeId ) ; $ contentDraft = $ this -> repository -> getContentService ( ) -> createContentDraft ( $ contentInfo , $ this -> repository -> getContentService ( ) -> loadVersionInfo ( $ contentInfo , $ versionNumber ) ) ; return new Values \ CreatedVersion ( array ( 'version' => new Values \ Version ( $ contentDraft , $ contentType , $ this -> repository -> getContentService ( ) -> loadRelations ( $ contentDraft -> getVersionInfo ( ) ) ) , ) ) ; }
The system creates a new draft version as a copy from the given version.

@param mixed $contentId
@param mixed $versionNumber

@return \eZ\Publish\Core\REST\Server\Values\CreatedVersion
The system creates a new draft version as a copy from the given version .