public function removePriceCategoryNgAction($priceCategory_id) { $em = $this->getDoctrine()->getManager(); $response = new Response(json_encode(array("result" => PriceCategory::removePriceCategoryById($em, $priceCategory_id)))); $response->headers->set('Content-Type', 'application/json'); return $response; }
public static function addPriceCategory($em, $parameters) { $priceCategory = new PriceCategory(); $priceCategory->setName($parameters->name); $priceCategory->setLevel($parameters->level); $em->persist($priceCategory); $em->flush(); return $priceCategory; }