public deleteContentTypeGroup ( mixed $contentTypeGroupId ) : eZ\Publish\Core\REST\Server\Values\NoContent | ||
$contentTypeGroupId | mixed | |
return | eZ\Publish\Core\REST\Server\Values\NoContent |
public function deleteContentTypeGroup($contentTypeGroupId)
{
$contentTypeGroup = $this->contentTypeService->loadContentTypeGroup($contentTypeGroupId);
$contentTypes = $this->contentTypeService->loadContentTypes($contentTypeGroup);
if (!empty($contentTypes)) {
throw new ForbiddenException('Only empty content type groups can be deleted');
}
$this->contentTypeService->deleteContentTypeGroup($contentTypeGroup);
return new Values\NoContent();
}