/** * Returns an array of choices for to be used in a form select type listing wallets. * @param string $userId * @return array */ private function generateWalletHtmlSelectChoices($userId) { $walletChoices = array(); $wallets = $this->walletRepository->walletsOfUserId(new UserId($userId)); foreach ($wallets as $wallet) { $walletChoices[$wallet->getId()->getValue()] = $wallet->getName(); } return $walletChoices; }
/** * @param UserId $userId * @return Wallet[] */ public function listWalletsOfUserId(UserId $userId) { $wallets = $this->walletRepository->walletsOfUserId($userId); return $wallets; }