public function executeAdd(sfWebRequest $request) { if ($request->isMethod('Post')) { $pharma = new Pharma(); $pharma->setType($request->getParameter('type')); $pharma->setName($request->getParameter('name')); $pharma->setStrength($request->getParameter('strength')); $pharma->setPrice($request->getParameter('price')); $pharma->setCompany($request->getParameter('company')); $pharma->setStatus(Constant::RECORD_STATUS_ACTIVE); $pharma->save(); $this->getUser()->setFlash('SUCCESS_MESSAGE', Constant::RECORD_ADDED_SUCCESSFULLY); $this->redirect('Pharma/list'); } //end if }