コード例 #1
0
 /**
  * @Template()
  * Efface les prévisions de T°C de l'eau
  * http://localhost/Wind/web/app_dev.php/admin/BO/ajax/spot/tempwater/delete/1
  */
 public function tempWaterDeleteAction($id)
 {
     $em = $this->container->get('doctrine.orm.entity_manager');
     $spot = $em->find('LaPoizWindBundle:Spot', $id);
     if (!$spot) {
         return $this->container->get('templating')->renderResponse('LaPoizWindBundle:Default:errorBlock.html.twig', array('errMessage' => "Spot not find !"));
     }
     $tempWaterURL = $spot->getTempWaterURL();
     if (!empty($tempWaterURL)) {
         TempWaterGetData::deleteTempWater($spot, $em, new NullOutput());
     }
     $previsionDate = $em->getRepository('LaPoizWindBundle:PrevisionDate')->findLastPrev(10, $spot);
     return $this->container->get('templating')->renderResponse('LaPoizWindBundle:BackOffice/Spot/Ajax/TempWater:tempWaterSaveResult.html.twig', array('previsionDateDB' => $previsionDateDB, 'spot' => $spot, 'message' => "", 'saveSuccess' => true));
 }