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