Exemplo n.º 1
0
 public function createAction()
 {
     $curtainPriceBandRepository = $this->getDoctrine()->getRepository('ElmetSiteBundle:CurtainPriceBand');
     $curtainPriceBand = $curtainPriceBandRepository->findOneById($this->getRequest()->get('priceband'));
     $curtainDesign = new CurtainDesign();
     $curtainDesign->setCurtainPriceBand($curtainPriceBand);
     $curtainDesign->setCushionFinish($this->getRequest()->get('cushionfinish'));
     $curtainDesign->setEyeletsAvailable($this->getRequest()->get('eyelets'));
     $curtainDesign->setFabricWidth($this->getRequest()->get('fabricwidth'));
     $curtainDesign->setFinish($this->getRequest()->get('curtainfinish'));
     $curtainDesign->setLined($this->getRequest()->get('lined'));
     $curtainDesign->setMaterials($this->getRequest()->get('materials'));
     $curtainDesign->setName($this->getRequest()->get('name'));
     $curtainDesign->setNew($this->getRequest()->get('new'));
     $curtainDesign->setPatternRepeatLength($this->getRequest()->get('patternrepeatlength'));
     $curtainDesign->setTapeSize($this->getRequest()->get('tapesize'));
     $curtainDesign->setUrlName($this->getRequest()->get('shortname'));
     $curtainDesign->setPosition($this->getRequest()->get('position'));
     $curtainDesign->setDisplay($this->getRequest()->get('display'));
     $curtainDesign->setSpecialPurchase($this->getRequest()->get('special'));
     $em = $this->getDoctrine()->getEntityManager();
     $em->persist($curtainDesign);
     $em->flush();
     return $this->viewAction($curtainDesign->getId());
 }