本文整理匯總了PHP中Vehicle::setMake方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vehicle::setMake方法的具體用法?PHP Vehicle::setMake怎麽用?PHP Vehicle::setMake使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vehicle
的用法示例。
在下文中一共展示了Vehicle::setMake方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCreate
public function testCreate()
{
$vehicle = new Vehicle();
$vehicle->setMPG(25);
$vehicle->setUser(new User());
$vehicle->setMake(new Make());
$this->assertSame(25, $vehicle->getMPG());
$this->assertTrue($vehicle->getUser() instanceof User);
$this->assertTrue($vehicle->getMake() instanceof Make);
}
示例2: castToVehicle
public function castToVehicle($obj)
{
$v = new Vehicle();
if (isset($obj->mount)) {
$v->setMount($obj->mount);
}
if (isset($obj->yearID)) {
$v->setYearID($obj->yearID);
}
if (isset($obj->makeID)) {
$v->setMakeID($obj->makeID);
}
if (isset($obj->modelID)) {
$v->setModelID($obj->modelID);
}
if (isset($obj->styleID)) {
$v->setStyleID($obj->styleID);
}
if (isset($obj->aaiaID)) {
$v->setAaiaID($obj->aaiaID);
}
if (isset($obj->year)) {
$v->setYear($obj->year);
}
if (isset($obj->make)) {
$v->setMake($obj->make);
}
if (isset($obj->model)) {
$v->setModel($obj->model);
}
if (isset($obj->style)) {
$v->setStyle($obj->style);
}
if (isset($obj->vehicleID)) {
$v->vehicleID = $obj->vehicleID;
}
if (isset($obj->installTime)) {
$v->installTime = $obj->installTime;
}
if (isset($obj->drilling)) {
$v->drilling = $obj->drilling;
}
if (isset($obj->exposed)) {
$v->exposed = $obj->exposed;
}
if (isset($obj->attributes)) {
$v->attributes = $obj->attributes;
}
return $v;
}