You are here

function rooms_pricing_update_calendar_event in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Get all the pricing events for the date range.

2 calls to rooms_pricing_update_calendar_event()
rooms_pricing_update_form_submit in modules/rooms_pricing/rooms_pricing.module
Submit callback for rooms_pricing_update_form form.
update_unit_pricing_form_submit in modules/rooms_pricing/rooms_pricing.module
Submit callback form update_unit_pricing_form form.

File

modules/rooms_pricing/rooms_pricing.module, line 577
Manages pricing for Bookable Units and displaying dates on the jquery FullCalendar plugin.

Code

function rooms_pricing_update_calendar_event($unit_id, $amount, $start_date, $end_date, $operation, $days = array()) {
  if (!empty($days)) {
    $rc = new UnitPricingCalendar($unit_id);
    $events = $rc
      ->calculatePricingEvents($unit_id, $amount, $start_date, $end_date, $operation, $days);
    $rc
      ->updateCalendar($events);
  }
  else {
    $rc = new UnitPricingCalendar($unit_id);
    $pe = new PricingEvent($unit_id, $amount, $start_date, $end_date, $operation);
    $events = array(
      $pe,
    );
    $rc
      ->updateCalendar($events);
  }
}