예제 #1
0
파일: Tache.php 프로젝트: PhilippeGeek/PHPM
 /**
  * Add plagesHoraire
  *
  * @param AssoMaker\PHPMBundle\Entity\PlageHoraire $plagesHoraire
  */
 public function addPlageHoraire(\AssoMaker\PHPMBundle\Entity\PlageHoraire $plageHoraire)
 {
     $plageHoraire->setTache($this);
     $this->plagesHoraire[] = $plageHoraire;
 }
예제 #2
0
 /**
  * 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());
 }