本文整理匯總了PHP中Vehicle::setUserId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vehicle::setUserId方法的具體用法?PHP Vehicle::setUserId怎麽用?PHP Vehicle::setUserId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vehicle
的用法示例。
在下文中一共展示了Vehicle::setUserId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getForm
public function getForm($object = null, $options = array())
{
if (null === $object) {
$object = new Vehicle();
}
$object->setUserId($this->getUserId());
return parent::getForm($object, $options);
}
示例2: executeAddVehicle
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');
}
示例3: executeCreate
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');
}