/** * Return the user object of the current user as well as an information, whether the user is * logged in. * * @return array Array containing the user object and a boolean, whether the user is logged in. * <pre> * array( * 'content' => Values\User\User object, * 'isLogged' => false * ) * </pre> */ public function getCurrentUser() { $currentUser = $this->repository->getCurrentUser(); $result = array(); // $result['versionInfo'] = $currentUser->versionInfo; $result['content'] = $currentUser; $result['isLogged'] = false; // TODO => deprecated function call *loadAnonymousUser()* $anonymousUserId = $this->userService->loadAnonymousUser()->content->versionInfo->contentInfo->id; if ($anonymousUserId && $anonymousUserId != $currentUser->id) { $result['isLogged'] = true; } return $result; }