public function deleteContentVersion($contentId, $versionNumber)
    {
        $versionInfo = $this->repository->getContentService()->loadVersionInfo(
            $this->repository->getContentService()->loadContentInfo($contentId),
            $versionNumber
        );

        if ($versionInfo->isPublished()) {
            throw new ForbiddenException('Version in status PUBLISHED cannot be deleted');
        }

        $this->repository->getContentService()->deleteVersion(
            $versionInfo
        );

        return new Values\NoContent();
    }
public function deleteContentVersion($contentId, $versionNumber)
    {
        $versionInfo = $this->repository->getContentService()->loadVersionInfo(
            $this->repository->getContentService()->loadContentInfo($contentId),
            $versionNumber
        );

        if ($versionInfo->isPublished()) {
            throw new ForbiddenException('Version in status PUBLISHED cannot be deleted');
        }

        $this->repository->getContentService()->deleteVersion(
            $versionInfo
        );

        return new Values\NoContent();
    }
public function deleteContentVersion ( $ contentId , $ versionNumber ) { $ versionInfo = $ this -> repository -> getContentService ( ) -> loadVersionInfo ( $ this -> repository -> getContentService ( ) -> loadContentInfo ( $ contentId ) , $ versionNumber ) ; if ( $ versionInfo -> isPublished ( ) ) { throw new ForbiddenException ( 'Version in status PUBLISHED cannot be deleted' ) ; } $ this -> repository -> getContentService ( ) -> deleteVersion ( $ versionInfo ) ; return new Values \ NoContent ( ) ; }
The version is deleted.

@param mixed $contentId
@param mixed $versionNumber

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

@return \eZ\Publish\Core\REST\Server\Values\NoContent
The version is deleted .