當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Vehicle::delete方法代碼示例

本文整理匯總了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();
開發者ID:rhalf,項目名稱:app_track,代碼行數:31,代碼來源:main.php

示例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;
開發者ID:rusty1909,項目名稱:Navigator,代碼行數:31,代碼來源:action.php

示例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');
 }
開發者ID:x4rMa,項目名稱:Vehicle-Inspection-System,代碼行數:15,代碼來源:VehicleController.php


注:本文中的Vehicle::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。