public function getForm($object = null, $options = array())
 {
     if (null === $object) {
         $object = new Vehicle();
     }
     $object->setUserId($this->getUserId());
     return parent::getForm($object, $options);
 }
Exemple #2
0
 public function executeAddVehicle(sfWebRequest $request)
 {
     $v = new Vehicle();
     $v->setUserId($this->getUserIdFromRouteOrSession());
     $this->form = new VehicleForm($v);
     $this->processVehicleForm($request, $this->form);
     $this->setTemplate('noVehicle');
 }
Exemple #3
0
 public function executeCreate(sfWebRequest $request)
 {
     $charge = new Vehicle();
     $charge->setUserId($this->getUserIdFromRouteOrSession());
     $this->form = $this->configuration->getForm($charge);
     $this->vehicle = $charge;
     $this->processForm($request, $this->form);
     $this->setTemplate('new');
 }