Example #1
0
 public function finishAction(Orders $orders)
 {
     $em = $this->getDoctrine()->getManager();
     $orders->setCompleted(true);
     $orders->setCancomment(true);
     $em->flush();
     $lobby = $this->getDoctrine()->getManager()->getRepository('challengePaymentBundle:Orders')->getLobby();
     return $this->render('challengeUserBundle:Lobby:index.html.twig', array('orders' => $lobby));
 }
 public function addAction(Request $request, Orders $order)
 {
     if ($order->getCancomment()) {
         $avis = new Avis();
         $form = $this->get('form.factory')->create(new AvisType(), $avis);
         if ($form->handleRequest($request)->isValid()) {
             $em = $this->getDoctrine()->getManager();
             $order->setCancomment(false);
             $order->setAvis($avis);
             $em->persist($order);
             $em->flush();
             return $this->redirect($this->generateUrl('challenge_feed_back_index'));
         }
         $orders = $this->getDoctrine()->getManager()->getRepository('challengePaymentBundle:Orders')->getOrders();
         return $this->render('challengeFeedBackBundle:Comments:comments.html.twig', array('orders' => $orders, 'order' => $order, 'form' => $form->createView()));
     }
     return $this->redirect($this->generateUrl('challenge_feed_back_index'));
 }