private function fetchLoggedAuthor(): Author
    {
        $author = new Author();

        try {
            $permissionResolver = $this->repository->getPermissionResolver();
            $userService = $this->repository->getUserService();
            $loggedUserId = $permissionResolver->getCurrentUserReference()->getUserId();
            $loggedUserData = $userService->loadUser($loggedUserId);

            $author->name = $loggedUserData->getName();
            $author->email = $loggedUserData->email;
        } catch (NotFoundException $e) {
            //Do nothing
        }

        return $author;
    }
private function fetchLoggedAuthor(): Author
    {
        $author = new Author();

        try {
            $permissionResolver = $this->repository->getPermissionResolver();
            $userService = $this->repository->getUserService();
            $loggedUserId = $permissionResolver->getCurrentUserReference()->getUserId();
            $loggedUserData = $userService->loadUser($loggedUserId);

            $author->name = $loggedUserData->getName();
            $author->email = $loggedUserData->email;
        } catch (NotFoundException $e) {
            //Do nothing
        }

        return $author;
    }
private function fetchLoggedAuthor ( ) : Author { $ author = new Author ( ) ; try { $ permissionResolver = $ this -> repository -> getPermissionResolver ( ) ; $ userService = $ this -> repository -> getUserService ( ) ; $ loggedUserId = $ permissionResolver -> getCurrentUserReference ( ) -> getUserId ( ) ; $ loggedUserData = $ userService -> loadUser ( $ loggedUserId ) ; $ author -> name = $ loggedUserData -> getName ( ) ; $ author -> email = $ loggedUserData -> email ; } catch ( NotFoundException $ e ) { //Do nothing } return $ author ; }
Returns currently logged user data, or empty Author object if none was found.

@return \eZ\Publish\Core\FieldType\Author\Author
Returns currently logged user data or empty Author object if none was found .