Exemplo n.º 1
0
 /** * @codeCoverageIgnore */
 public function createAction()
 {
     $repository = $this->getDoctrine()->getRepository('ElmetSiteBundle:CurtainPriceBand');
     $curtainPriceBand = $repository->findOneByName('A');
     $curtainDesign = new CurtainDesign();
     $curtainDesign->setUrlName("elevetham");
     $curtainDesign->setName("elevetham");
     $curtainDesign->setMaterials("100% Silk");
     $curtainDesign->setTapeSize("3");
     $curtainDesign->setLined('1');
     $curtainDesign->setEyeletsAvailable(1);
     $curtainDesign->setFabricWidth(140);
     $curtainDesign->setPatternRepeatLength(8.0);
     $curtainDesign->setFinish("Fringed");
     $curtainDesign->setCushionFinish("Corded");
     $curtainDesign->setNew('1');
     $curtainDesign->setCurtainPriceBand($curtainPriceBand);
     $curtainColour = new CurtainColour();
     $curtainColour->setName("Black");
     $curtainColour->setCurtainDesign($curtainDesign);
     $curtainColour->setFullFilepath("/fullpath");
     $curtainColour->setSwatchFilepath("/swatchpath");
     $curtainColour->setThumbnailFilepath("/thumbnailpath");
     $curtainColour->setInStock(1);
     $curtainColour->setBuynow(1);
     $em = $this->getDoctrine()->getEntityManager();
     $em->persist($curtainDesign);
     $em->persist($curtainColour);
     $em->flush();
     return new Response('Created curtain design id ' . $curtainDesign->getId() . ' Created curtain colour id ' . $curtainColour->getId());
 }
Exemplo n.º 2
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());
 }