eZ\Publish\Core\Repository\ContentTypeService::deleteContentTypeGroup PHP Метод

deleteContentTypeGroup() публичный Метод

This method only deletes an content type group which has content types without any content instances
public deleteContentTypeGroup ( eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup $contentTypeGroup )
$contentTypeGroup eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup
    public function deleteContentTypeGroup(APIContentTypeGroup $contentTypeGroup)
    {
        if ($this->repository->hasAccess('class', 'delete') !== true) {
            throw new UnauthorizedException('ContentType', 'delete');
        }
        $loadedContentTypeGroup = $this->loadContentTypeGroup($contentTypeGroup->id);
        $this->repository->beginTransaction();
        try {
            $this->contentTypeHandler->deleteGroup($loadedContentTypeGroup->id);
            $this->repository->commit();
        } catch (APIBadStateException $e) {
            $this->repository->rollback();
            throw new InvalidArgumentException('$contentTypeGroup', 'Content type group has content type instances', $e);
        } catch (Exception $e) {
            $this->repository->rollback();
            throw $e;
        }
    }