/** * Displays a form to create a new ProductPrices entity. * * @Route("/new", name="pricing_new") * @Method("GET") * @Template() */ public function newAction() { $request = Request::createFromGlobals(); $product_id = $request->query->get('product_id'); $em = $this->getDoctrine()->getManager(); $product = $em->getRepository('MeVisaERPBundle:Products')->find($product_id); $entity = new ProductPrices(); $entity->setProduct($product); $form = $this->createCreateForm($entity); return array('entity' => $entity, 'form' => $form->createView(), 'product' => $product); }
/** * Add pricing * * @param \MeVisa\ERPBundle\Entity\ProductPrices $pricing * @return Products */ public function addPricing(\MeVisa\ERPBundle\Entity\ProductPrices $pricing) { $this->pricing[] = $pricing; $pricing->setProduct($this); return $this; }