Esempio n. 1
0
 /**
  * @param Uuid $id
  * @return User
  * @throws ObjectNotFoundException
  */
 public function getUser(Uuid $id)
 {
     $user = $this->storage->find($id->getValue());
     if ($user == null) {
         throw new ObjectNotFoundException('User', $id);
     }
     return $user;
 }
Esempio n. 2
0
 /**
  * @param Uuid $id
  * @return Book
  * @throws ObjectNotFoundException
  */
 public function getBook(Uuid $id)
 {
     $book = $this->storage->find($id->getValue());
     if ($book === null) {
         throw new ObjectNotFoundException('Book', $id);
     }
     return $book;
 }