/** * @param OpenAccountCommand $command * @return void */ public function handle($command) { $account = Account::open($command->getService(), $command->getAccountNumber(), $command->getRecurringCharge(), $command->getDateOpened(), $command->getBillingPeriod()); $this->accountRepository->save($account); $this->dispatch('account.opened', new AccountWasOpenedEvent($account)); }
/** * @return Response */ public function indexAction() { $accounts = $this->accountRepository->findAll(); $upcomingBills = $this->billRepository->findBillsDue(new \DateInterval('P1M')); return new Response($this->templating->render('@HCLabsBills/Dashboard/index.html.twig', ['accounts' => $accounts, 'upcoming_bills' => $upcomingBills])); }