public function getForm($object = null, $options = array()) { if (null === $object) { $object = new Vehicle(); } $object->setUserId($this->getUserId()); return parent::getForm($object, $options); }
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'); }
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'); }