/** * @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; }
/** * @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; }