コード例 #1
0
ファイル: SessionEntityTrait.php プロジェクト: sinergi/users
 /** @return UserEntityInterface */
 public function getUser()
 {
     if ($this->user && $this->user->getId() === $this->getUserId()) {
         return $this->user;
     } elseif (!$this->userRepository) {
         throw new \Exception('Cannot fetch user without user repository');
     }
     return $this->user = $this->userRepository->findById($this->getUserId());
 }