public function executeFormTest(sfWebRequest $request) { $vente = new Vente(); $vente->setIdAgent($this->getUser()->getLoggedUserId()); $vente->setQuestion(QuestionTable::getInstance()->find(20)); $this->venteForm = new VenteForm($vente); if ($request->isMethod('post')) { $this->venteForm->bind($request->getParameter('vente')); if ($this->venteForm->isValid()) { $this->venteForm->save(); } } }
public function executeNew(sfWebRequest $request) { $vente = new Vente(); $vente->setIdQuestion(1); $this->form = new VenteForm($vente); }