public function startNextRound() { $currentRound = $this->roundRepo->findCurrent(); // check if settings for next round exist if (!($nextRound = $this->roundRepo->find($currentRound->getId() + 1))) { $nextRound = clone $currentRound; // __clone removes id $this->em->persist($nextRound); } $currentRound->setFinished(true); $nextRound->setStarted(true); $this->em->flush(); }
public function __construct(CoinManagerContainer $coinManagerContainer, EntityManager $em, DepositRepository $depositRepo, RoundRepository $roundRepo) { $this->depositRepo = $depositRepo; $this->manager = $coinManagerContainer->get('main'); $this->round = $roundRepo->findCurrent(); $this->em = $em; }
public function __construct(WalletManager $walletManager, EntityManager $em, PayoutRepository $payoutRepo, RoundRepository $roundRep, DepositRepository $depositRepo) { $this->walletManager = $walletManager; $this->em = $em; $this->payoutRepo = $payoutRepo; $this->round = $roundRep->findCurrent(); $this->depositRepo = $depositRepo; }
/** * @Route("/reset", name="reset") * @Template() */ public function resetAction() { $round = $this->roundRepo->findCurrent(); $this->getSession()->clear(); return $this->redirect($this->generateUrl('stats', ['round' => $round->getId()])); }