/** * Returns logged user entity * * @return UserEntity|false */ public function getAuthentificatedUserEntity() { if (!$this->sessionContainer->userEntity && $this->isLoggedIn()) { $user = $this->userTable->getByEmail($this->authService->getIdentity()); if ($user) { $this->sessionContainer->userEntity = $user->getValues(); } } if ($this->sessionContainer->userEntity) { if (null === $this->authentificatedUser) { $this->authentificatedUser = $this->userTable->create($this->sessionContainer->userEntity); } return $this->authentificatedUser; } return false; }