本文整理汇总了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');
}