private function saveProduc($producData) { $newProduct = new Product(); $newProduct->setTitle($producData['title']); $newProduct->setDescription($producData['description']); $newProduct->setPrice($producData['price']); $newProduct->setInit($producData['init']); $newProduct->setExpiry($producData['expiry']); $newProduct->setAddress($producData['address']); $newProduct->setName($producData['name']); $newProduct->setTextorigin($producData['textOrigiin']); $em = $this->getDoctrine()->getManager(); $em->persist($newProduct); $em->flush(); return true; }