public function loadContentInfo($contentId) { $contentInfo = $this->internalLoadContentInfo($contentId); if (!$this->repository->canUser('content', 'read', $contentInfo)) { throw new UnauthorizedException('content', 'read', array('contentId' => $contentId)); } return $contentInfo; }
/** * Returns author of the content. * * @param \eZ\Publish\API\Repository\Values\Content\Content $contentValue * @param \eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType * * @return string */ private function getAuthor(Content $contentValue, ContentType $contentType) { $author = $contentValue->getFieldValue($this->value->getConfiguredFieldIdentifier('author', $contentType)); if (null === $author) { $ownerId = empty($contentValue->contentInfo->ownerId) ? $this->defaultAuthorId : $contentValue->contentInfo->ownerId; $userContentInfo = $this->contentService->loadContentInfo($ownerId); $author = $userContentInfo->name; } return (string) $author; }