Esempio n. 1
0
 /** @return UserEntityInterface[] */
 public function getUsers()
 {
     if (is_array($this->users)) {
         return $this->users;
     } elseif (!$this->userRepository) {
         throw new \Exception('Cannot fetch users without user repository');
     }
     return $this->users = $this->userRepository->findByGroupId($this->getId());
 }
Esempio n. 2
0
 /** @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());
 }