当前位置: 首页>>代码示例>>PHP>>正文


PHP Booking::destroy方法代码示例

本文整理汇总了PHP中Booking::destroy方法的典型用法代码示例。如果您正苦于以下问题:PHP Booking::destroy方法的具体用法?PHP Booking::destroy怎么用?PHP Booking::destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Booking的用法示例。


在下文中一共展示了Booking::destroy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: destroy

 public function destroy($kitTypeID)
 {
     // This Shall be fun!
     // We have to deconstruct the types based on the forign key dependencys
     // First iterate all the kits, for each kit remove all contents,
     // and then all bookings (and all booking details)
     // then finally we can remove the kit type and then all the logs for that
     // kit type.
     foreach (Kits::where('KitType', '=', $kitTypeID)->get() as $kit) {
         foreach (KitContents::where("KitID", '=', $kit->ID)->get() as $content) {
             KitContents::destroy($content->ID);
         }
         foreach (Booking::where("KitID", '=', $kit->ID)->get() as $booking) {
             foreach (BookingDetails::where("BookingID", '=', $booking->ID)->get() as $detail) {
                 BookingDetails::destroy($detail->ID);
             }
             Booking::destroy($booking->ID);
         }
         Kits::destroy($kit->ID);
     }
     KitTypes::destroy($kitTypeID);
     // Do the logs last, as all the deletes will log the changes of deleting the bits.
     Logs::where('LogKey1', '=', $kitTypeID)->delete();
     return "OK";
 }
开发者ID:KWinston,项目名称:EPLProject,代码行数:25,代码来源:KitTypesController.php

示例2: deleteBooking

 public function deleteBooking()
 {
     if (!Request::ajax()) {
         return "not a json request";
     }
     $post = Input::all();
     BookingDetails::where('BookingID', '=', $post['BookID'])->delete();
     Booking::destroy($post['BookID']);
     return Response::json(array('success' => true), 200);
 }
开发者ID:KWinston,项目名称:EPLProject,代码行数:10,代码来源:BookKitController.php

示例3: destroy

 /**
  * Remove the specified booking from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     Booking::destroy($id);
     return Redirect::route('bookings.index');
 }
开发者ID:tharindarodrigo,项目名称:agent,代码行数:11,代码来源:BookingsController.php

示例4: deleteAjax

 public function deleteAjax()
 {
     $booking_id = Input::get('booking_id');
     $booking_item_id = Input::get('id');
     $booking = Booking::find($booking_id);
     if (!$booking) {
         return Response::json(array('status' => 'KO', 'message' => 'Réservation inconnue'));
     }
     $user = $booking->user;
     $booking_item = BookingItem::find($booking_item_id);
     $ressource = $booking_item->ressource;
     if ($booking->items()->count() == 1) {
         BookingItem::destroy($booking_item_id);
         Booking::destroy($booking_id);
     } else {
         BookingItem::destroy($booking_item_id);
     }
     try {
         $this->sendDeletedBookingNotification($booking_item, $ressource, $booking, $user);
     } catch (\Exception $e) {
     }
     if (Request::ajax()) {
         return Response::json(array('status' => 'OK', 'id' => $booking_item_id));
     }
     return Redirect::route('booking_list')->with('mSuccess', 'La réservation a été supprimée');
 }
开发者ID:urashima82,项目名称:intranet,代码行数:26,代码来源:BookingController.php

示例5: destroy

 public function destroy($kitID)
 {
     $kit = Kits::find($kitID);
     foreach (Booking::where('KitID', '=', $kitID)->get() as $book) {
         foreach (BookingDetails::where('BookingID', '=', $book->ID)->get() as $detail) {
             BookingDetails::destroy($detail->ID);
         }
         Booking::destroy($book->ID);
     }
     foreach ($kit->contents as $content) {
         KitContents::destroy($content->ID);
     }
     Kits::destroy($kitID);
 }
开发者ID:KWinston,项目名称:EPLProject,代码行数:14,代码来源:KitsController.php

示例6: destroy

 public function destroy($leadership_event_id, $id)
 {
     Booking::destroy($id);
     return Redirect::route('booking.index', array($leadership_event_id));
 }
开发者ID:ajwgibson,项目名称:leadership,代码行数:5,代码来源:BookingController.php


注:本文中的Booking::destroy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。