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