protected function UnitPricingCalendar::preparePartialMonthArray in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7
Given an event it prepares a partial array covering just the days for which the event is involved
Parameters
RoomsEventInterface $event: The event to process.
Return value
array The days of the month states processed array.
Overrides RoomsCalendar::preparePartialMonthArray
File
- modules/
rooms_pricing/ includes/ rooms_pricing.unit_pricing_calendar.inc, line 524 - Contains UnitPricingCalendar.
Class
- UnitPricingCalendar
- Handles querying and updating the pricing information relative to a single bookable unit.
Code
protected function preparePartialMonthArray(RoomsEventInterface $event) {
$days = array();
for ($i = $event
->startDay(); $i <= $event
->endDay(); $i++) {
$days['d' . $i] = commerce_currency_decimal_to_amount($event->amount, commerce_default_currency());
}
return $days;
}