Exemplo n.º 1
0
 private function createSeason(ObjectManager $em, $perimeter)
 {
     $season = new Season();
     $season->setPerimeter($perimeter);
     $season->setTitle('hiver 2014');
     $season->setStartDate(\DateTime::createFromFormat('d/m/Y', '21/12/2013'));
     $season->setEndDate(\DateTime::createFromFormat('d/m/Y', '21/03/2014'));
     $season->setPublished(TRUE);
     $em->persist($season);
     return $season;
 }
Exemplo n.º 2
0
 public function getSeasonWithPerimeterAndSeasonId(Perimeter $perimeter, $seasonId)
 {
     $season = null;
     if ($seasonId) {
         $season = $this->find($seasonId);
     }
     if (!$season) {
         $season = new SeasonEntity();
         $season->setPerimeter($perimeter);
     }
     return $season;
 }