예제 #1
0
파일: MainParser.php 프로젝트: Quiss/Oon
 public function refreshStatus(Banner $banner, $status, $hot = null)
 {
     return true;
     $months = $banner->getMonths();
     foreach ($months as $m) {
         $this->em->remove($m);
     }
     foreach ($status as $m => $s) {
         $date = new \DateTime($m . ' 00:00:00');
         $month = new Month();
         $month->setBanner($banner);
         $month->setDate($date);
         $month->setStatus($s);
         if ($hot) {
             if ($m == $hot['date']) {
                 $month->setSale($hot['sale']);
             }
         }
         $this->em->persist($month);
         $this->em->flush($month);
     }
 }