本文整理汇总了PHP中Vehicle::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Vehicle::delete方法的具体用法?PHP Vehicle::delete怎么用?PHP Vehicle::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vehicle
的用法示例。
在下文中一共展示了Vehicle::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: catch
Flight::ok($object);
} catch (Exception $exception) {
Flight::error($exception);
}
});
Flight::route('PUT /v1/main/vehicle/@id', function ($id) {
try {
$object = Vehicle::update($id);
Flight::ok($object);
} catch (Exception $exception) {
Flight::error($exception);
}
});
Flight::route('DELETE /v1/main/vehicle/@id', function ($id) {
try {
$object = Vehicle::delete($id);
Flight::ok($object);
} catch (Exception $exception) {
Flight::error($exception);
}
});
//=============================================================================
//VehicleCollection
//=============================================================================
Flight::route('GET /v1/main/vehiclecollection', function () {
$collection = Flight::request()->query->collection;
try {
if ($collection) {
$array = VehicleCollection::selectByCollection($collection);
} else {
$array = VehicleCollection::selectAll();
示例2: header
header('Location:abc.php');
}
break;
case "delete":
$id = $_GET['id'];
echo $_GET['id'];
$mVehicle = new Vehicle($id);
/* if getCurrentJob() retruns o means vehicle is not on job... */
if ($mVehicle->isOnTrip() != 0 || $mVehicle->getCurrentJob() != 0) {
echo '<script language="javascript">';
echo 'alert("Vehicle is on Job, can\'t delte now !!!")';
echo '</script>';
header('Location:index.php');
break;
}
if ($mVehicle->delete()) {
$adder = new VehicleMailer($id);
$adder->sendVehicleDeletedMessage();
header('Location:index.php');
} else {
header('Location:index.php');
}
//header('Location:abc.php');
break;
case "set_driver":
$id = $_GET['id'];
$driver_id = $_GET['driverid'];
//echo $_GET['id'];
$mVehicle = new Vehicle($id);
if ($mVehicle->setDriver($driver_id)) {
echo 1;
示例3: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy(Vehicle $vehicles)
{
$vehicles->inspection()->delete();
$vehicles->inspectordetails()->delete();
$vehicles->certificate()->delete();
$vehicles->delete();
//Event::fire('vehicle.deleted', [$vehicle]);
return Redirect::to('vehicles')->with('success', 'Vehicle Deleted Successfully');
}