/** * Index action * * @return void */ public function indexAction() { $monthIdentifier = $this->electomatService->getMonthIdentifierLastMonth(); $this->view->assign('numberOfCommits', $this->commitRepository->getCommitsByMonth($monthIdentifier)->count()); $this->view->assign('numberOfActiveRepositories', $this->repositoryRepository->extractTheRepositoriesFromAStackOfCommits($this->commitRepository->getCommitsByMonth($monthIdentifier))->count()); $this->view->assign('numberOfMonitoredRepositories', $this->repositoryRepository->countByIsActive(TRUE)); $this->view->assign('numberOfCommitters', $this->aggregatedDataPerUserRepository->findNumberOfCommittersPerMonth($monthIdentifier)); $this->view->assign('coderOfTheMonthAward', $this->awardRepository->findLatestAwards(1)->getFirst()); $this->view->assign('currentTopicAwards', $this->awardRepository->findCurrentTopicAwards()); }
/** * Creates an award of a given type * * @param string the type of the award * @param string the month identifier * @param \Mrimann\CoMo\Domain\Model\AggregatedDataPerUser $winner * * @return \Mrimann\CoMo\Domain\Model\Award the new award */ protected function createNewAward($type, $monthIdentifier, \Mrimann\CoMo\Domain\Model\AggregatedDataPerUser $winner) { $award = new \Mrimann\CoMo\Domain\Model\Award(); $award->setUserEmail($winner->getUserEmail()); $award->setUserName($winner->getUserName()); $award->setType($type); $award->setMonth($monthIdentifier); $award->setCommitCount($winner->getCommitCountByType($type)); $this->awardRepository->add($award); return $award; }