You are here

public function UnitPricingCalendar::__construct in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Constructs a UnitPricingCalendar instance.

Parameters

int $unit_id: The unit ID.

array $price_modifiers: The price modifiers to apply.

File

modules/rooms_pricing/includes/rooms_pricing.unit_pricing_calendar.inc, line 42
Contains UnitPricingCalendar.

Class

UnitPricingCalendar
Handles querying and updating the pricing information relative to a single bookable unit.

Code

public function __construct($unit_id, $price_modifiers = array()) {
  $this->unit_id = $unit_id;

  // Load the booking unit.
  $this->unit = rooms_unit_load($unit_id);
  $this->default_state = $this->unit->default_state;
  $this->default_price = $this->unit->base_price;
  $this->price_modifiers = $price_modifiers;
  $this->base_table = 'rooms_pricing';
}