public function RoomsBookingController::delete in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7
Implements EntityAPIControllerInterface.
Parameters
$transaction: Optionally a DatabaseTransaction object to use. Allows overrides to pass in their transaction object.
Overrides EntityAPIController::delete
File
- modules/
rooms_booking/ rooms_booking.module, line 1120 - Manage Bookings - Bookings are tied to a customer profile and possible a Unit ID and Order ID.
Class
- RoomsBookingController
- The Controller for RoomsBooking entities.
Code
public function delete($ids, $delete_line_item = TRUE) {
foreach ($ids as $id) {
$booking = rooms_booking_load($id);
// Update the availability calendar.
$this
->delete_event($booking);
if ($delete_line_item) {
// Delete the line_item associated with this booking.
$this
->delete_line_item($booking);
}
}
parent::delete($ids);
}