Rest/Content/Content.php
private function getAuthor(ApiContent $contentValue, ApiContentType $contentType)
    {
        $author = $contentValue->getFieldValue(
            $this->value->getConfiguredFieldIdentifier('author', $contentType)
        );

        if (null === $author) {
            try {
                $ownerId = empty($contentValue->contentInfo->ownerId) ? $this->defaultAuthorId : $contentValue->contentInfo->ownerId;
                $userContentInfo = $this->contentService->loadContentInfo($ownerId);
                $author = $userContentInfo->name;
            } catch (UnauthorizedException $e) {
                $author = '';
            }
        }

        return (string) $author;
    }
private function getAuthor(ApiContent $contentValue, ApiContentType $contentType)
    {
        $author = $contentValue->getFieldValue(
            $this->value->getConfiguredFieldIdentifier('author', $contentType)
        );

        if (null === $author) {
            try {
                $ownerId = empty($contentValue->contentInfo->ownerId) ? $this->defaultAuthorId : $contentValue->contentInfo->ownerId;
                $userContentInfo = $this->contentService->loadContentInfo($ownerId);
                $author = $userContentInfo->name;
            } catch (UnauthorizedException $e) {
                $author = '';
            }
        }

        return (string) $author;
    }
private function getAuthor ( ApiContent $ contentValue , ApiContentType $ contentType ) { $ author = $ contentValue -> getFieldValue ( $ this -> value -> getConfiguredFieldIdentifier ( 'author' , $ contentType ) ) ; if ( null === $ author ) { try { $ ownerId = empty ( $ contentValue -> contentInfo -> ownerId ) ? $ this -> defaultAuthorId : $ contentValue -> contentInfo -> ownerId ; $ userContentInfo = $ this -> contentService -> loadContentInfo ( $ ownerId ) ; $ author = $ userContentInfo -> name ; } catch ( UnauthorizedException $ e ) { $ author = '' ; } } return ( string ) $ author ; }
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
Returns author of the content .