예제 #1
0
 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();
     }
   }
 }
예제 #2
0
 public function executeNew(sfWebRequest $request)
 {
   $vente = new Vente();
   $vente->setIdQuestion(1);
   $this->form = new VenteForm($vente);
 }