Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
match scheme update
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Poppe <stephanepoppe@gmail.com>
  • Loading branch information
stephanepoppe committed Jan 11, 2013
1 parent 41cb4bb commit e654f5c
Showing 1 changed file with 31 additions and 1 deletion.
Expand Up @@ -14,6 +14,9 @@
use MatchTracker\Bundle\AppBundle\Entity\Players;
use MatchTracker\Bundle\AppBundle\Form\TeamsType;
use MatchTracker\Bundle\AppBundle\Entity\Matches;
use MatchTracker\Bundle\AppBundle\Entity\Standings;
use MatchTracker\Bundle\AppBundle\Entity\Statistics;


use Doctrine\ORM\EntityRepository;

Expand Down Expand Up @@ -143,6 +146,7 @@ public function teamsAction($nameCanonical, Request $request) {
)
);
$this->get('mailer')->send($message);

}


Expand All @@ -151,6 +155,7 @@ public function teamsAction($nameCanonical, Request $request) {
$em->persist($competition);
$em->flush();


// Redirect to new canonical url
// return $this->redirect($this->generateUrl('mycompetitions'));
}
Expand Down Expand Up @@ -224,6 +229,8 @@ public function scheduleAction($nameCanonical, Request $request) {
$em = $this->getDoctrine()->getManager();
$em->persist($match);
$em->flush();


}
} while ($ok != true);

Expand All @@ -232,9 +239,32 @@ public function scheduleAction($nameCanonical, Request $request) {

}


//}

// make a standing
$standing = new Standings();
$standing->setName("Klassement");


// make statistics for each team
foreach ($teams as $team){
//statistics
$statistic = new Statistics();
$statistic->setDraws(0);
$statistic->setLosses(0);
$statistic->setPoints(0);
$statistic->setWins(0);
$statistic->setPosition(1);
$statistic->setTeams($team);
$standing->addStatistic($statistic);

}

$league->addStanding($standing);
$em = $this->getDoctrine()->getManager();
$em->persist($league);
$em->flush();

return $this->render('MatchTrackerAppBundle:Dashboard:index.html.twig');
}

Expand Down

0 comments on commit e654f5c

Please sign in to comment.