Exemplo n.º 1
0
 /**
  * @param Team $team
  * @return Team
  */
 private function createTeamIfNotFound($team)
 {
     $team->setPlayerA($this->createPlayerIfNotFound($team->getPlayerA()));
     $team->setPlayerB($this->createPlayerIfNotFound($team->getPlayerB()));
     try {
         return $this->teamRepository->findOneByPlayers($team->getPlayerA(), $team->getPlayerB());
     } catch (EntityNotFoundException $e) {
         $this->teamRepository->persist($team);
         return $team;
     }
 }
Exemplo n.º 2
0
 private function setupTeam()
 {
     $team = new Team();
     $this->teamRepository->create($team);
     return $team;
 }