예제 #1
0
 /**
  * Finds and displays a Avenant entity.
  *
  */
 public function showAction($marcheId, $numero)
 {
     $this->verifyAccess();
     $em = $this->getDoctrine()->getManager();
     $entity = $em->getRepository('LaisoArmBundle:Avenant')->findOneBy(array('marche' => $marcheId, 'libelle' => $em->getRepository('LaisoArmBundle:LibelleAvenant')->findBy(array('numero' => $numero))));
     if (!$entity) {
         throw $this->createNotFoundException('Unable to find Avenant entity.');
     }
     if ($entity->getMarche()->getLotissement()->getValide() == false) {
         throw new NotFoundHttpException('Marché non trouvé');
     }
     $deleteForm = $this->createDeleteForm($numero, $marcheId);
     $dqe = new DQE();
     $dqe->setAvenant($entity);
     $dqe->setConsistances($entity->getMarche()->getLotissement()->getConsistances());
     return $this->render('LaisoArmBundle:Avenant:show.html.twig', array('entity' => $entity, 'dqe' => $dqe, 'delete_form' => $deleteForm->createView()));
 }
예제 #2
0
 /**
  * Finds and displays a Lotissement entity.
  *
  */
 public function showAction(Request $request, Lotissement $entity)
 {
     $this->verifyAccess();
     $deleteForm = $this->createDeleteForm($entity->getId());
     $dqe = new DQE();
     $dqe->setAvenant($this->getDoctrine()->getRepository("LaisoArmBundle:Avenant")->findBy(array('marche' => $this->getDoctrine()->getRepository("LaisoArmBundle:Marche")->findBy(array('lotissement' => $entity->getId()))))[0]);
     $dqe->setConsistances($entity->getConsistances());
     return $this->render('LaisoArmBundle:Lotissement:show.html.twig', array('entity' => $entity, 'dqe' => $dqe, 'delete_form' => $deleteForm->createView()));
 }