Beispiel #1
0
 /**
  * Add plagesHoraire
  *
  * @param AssoMaker\PHPMBundle\Entity\PlageHoraire $plagesHoraire
  */
 public function addPlageHoraire(\AssoMaker\PHPMBundle\Entity\PlageHoraire $plageHoraire)
 {
     $plageHoraire->setTache($this);
     $this->plagesHoraire[] = $plageHoraire;
 }
 /**
  * Creates a new PlageHoraire entity assigned to a tache.
  *
  * @Route("/newTache/{idtache}", name="plagehoraire_tache_new")
  * @Template("AssoMakerPHPMBundle:PlageHoraire:new.html.twig")
  */
 public function newTacheAction($idtache)
 {
     if (false === $this->get('security.context')->isGranted('ROLE_USER')) {
         throw new AccessDeniedException();
     }
     $em = $this->getDoctrine()->getEntityManager();
     $tache = $em->getRepository('AssoMakerPHPMBundle:Tache')->find($idtache);
     $entity = new PlageHoraire();
     $entity->setTache($tache);
     $form = $this->createForm(new PlageHoraireType(), $entity);
     return array('entity' => $entity, 'form' => $form->createView());
 }