/**
  * @Secure(roles="ROLE_ADMIN")
  */
 public function supprimerAction(Episode $episode)
 {
     $em = $this->getDoctrine()->getEntityManager();
     if ($episode->getActive() == 1) {
         $episode->setActive(0);
         $this->get("session")->setFlash('error', 'Épisode désactivé!');
     } else {
         $episode->setActive(1);
         $this->get("session")->setFlash('succes', 'Épisode activé!');
     }
     $em->flush();
     return $this->redirect($this->generateUrl('Episode_liste'));
 }
Exemple #2
0
 /**
  * Add Episodes
  *
  * @param SerieZone\SerieBundle\Entity\Episode $episodes
  */
 public function addEpisode(\SerieZone\SerieBundle\Entity\Episode $episode)
 {
     $episode->setSerie($this);
     $this->Episodes[] = $episode;
 }
 public function linkValide(\Symfony\Component\Validator\ExecutionContext $context)
 {
     $this->__load();
     return parent::linkValide($context);
 }