本文整理汇总了PHP中eZ\Publish\API\Repository\ContentTypeService::isContentTypeUsed方法的典型用法代码示例。如果您正苦于以下问题:PHP ContentTypeService::isContentTypeUsed方法的具体用法?PHP ContentTypeService::isContentTypeUsed怎么用?PHP ContentTypeService::isContentTypeUsed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZ\Publish\API\Repository\ContentTypeService
的用法示例。
在下文中一共展示了ContentTypeService::isContentTypeUsed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: viewContentTypeAction
public function viewContentTypeAction($contentTypeId, $languageCode = null)
{
$languageCode = $languageCode ?: $this->prioritizedLanguages[0];
$contentType = $this->contentTypeService->loadContentType($contentTypeId);
$countQuery = new Query(['filter' => new Query\Criterion\ContentTypeId($contentTypeId), 'limit' => 0]);
$contentCount = $this->searchService->findContent($countQuery, [], false)->totalCount;
$deleteForm = $this->createForm(new ContentTypeDeleteType(), ['contentTypeId' => $contentTypeId]);
return $this->render('eZPlatformUIBundle:ContentType:view_content_type.html.twig', ['language_code' => $languageCode, 'content_type' => $contentType, 'content_count' => $contentCount, 'modifier' => $this->userService->loadUser($contentType->modifierId), 'delete_form' => $deleteForm->createView(), 'can_edit' => $this->isGranted(new Attribute('class', 'update')), 'can_delete' => $this->isGranted(new Attribute('class', 'delete')) && !$this->contentTypeService->isContentTypeUsed($contentType)]);
}
示例2: isContentTypeUsed
/**
* Returns true if the given content type $contentType has content instances.
*
* @since 6.0.1
*
* @param \eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType
*
* @return bool
*/
public function isContentTypeUsed(ContentType $contentType)
{
return $this->service->isContentTypeUsed($contentType);
}