当前位置: 首页>>代码示例>>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;未经允许,请勿转载。