Get service object to perform operations on Content Type objects and it's aggregate members.
( Group, Field & FieldCategory )
public getContentTypeService ( ) : eZ\Publish\API\Repository\ContentTypeService | ||
리턴 | eZ\Publish\API\Repository\ContentTypeService |
/** * Returns ContentType identifier based on $contentId. * * @param int|mixed $contentId * * @return string */ private function getContentTypeIdentifier($contentId) { $contentTypeService = $this->repository->getContentTypeService(); $contentService = $this->repository->getContentService(); $contentType = $this->repository->sudo(function () use($contentId, $contentTypeService, $contentService) { $contentType = $contentTypeService->loadContentType($contentService->loadContent($contentId)->contentInfo->contentTypeId); return $contentType; }); return $contentType->identifier; }
public function __construct(Repository $repository) { $this->repository = $repository; $this->service = $this->repository->getContentTypeService(); }