You are here

interface UnitPricingCalendarInterface in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

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

Hierarchy

Expanded class hierarchy of UnitPricingCalendarInterface

All classes that implement UnitPricingCalendarInterface

File

modules/rooms_pricing/includes/rooms_pricing.unit_pricing_calendar_interface.inc, line 12
Contains UnitPricingCalendarInterface.

View source
interface UnitPricingCalendarInterface extends RoomsCalendarInterface {

  /**
   * Apply price modifiers to base price.
   *
   * @param float $base_price
   *   The price to modify.
   * @param int $days
   *   The event duration.
   * @param array $reply
   *   A log of prices changes
   *
   * @return float
   *   The modified price.
   */
  public function applyPriceModifiers($base_price, $days, &$reply);

  /**
   * Get a set of PricingEvent between start_date and end_date filtered by days.
   *
   * @param int $unit_id
   *   The unit id to calculate.
   * @param int $amount
   *   The initial amount.
   * @param DateTime $start_date
   *   The start date.
   * @param DateTime $end_date
   *   The end date.
   * @param string $operation
   *   The operation to perform.
   * @param int $days
   *   The event duration.
   *
   * @return PricingEventInterface[]
   *   The events in that range of dates
   */
  public function calculatePricingEvents($unit_id, $amount, DateTime $start_date, DateTime $end_date, $operation, $days);

  /**
   * Given a date range determine the cost of the room over that period.
   *
   * @param DateTime $start_date
   *   The starting date for the search.
   * @param DateTime $end_date
   *   The end date for the search.
   * @param int $persons
   *   The number of persons staying in this room.
   * @param int $children
   *   The number of children staying in this room.
   * @param array $children_ages
   *   Children ages.
   *
   * @return array
   *   Array holding full price and booking price of the room for that period.
   */
  public function calculatePrice(DateTime $start_date, DateTime $end_date, $persons = 0, $children = 0, $children_ages = array());

}

Members

Namesort descending Modifiers Type Description Overrides
RoomsCalendarInterface::addMonthEvent public function Adds an event to the calendar 1
RoomsCalendarInterface::getEvents public function Given a date range returns an array of RoomEvents. The heavy lifting really takes place in the getRawDayData function - here we are simply acting as a factory for event objects 1
RoomsCalendarInterface::getRawDayData public function Given a date range it returns all data within that range including the start and end dates of states. The MySQL queries are kept simple and then the data is cleared up. 1
RoomsCalendarInterface::monthDefined public function Checks if a month exists. 1
RoomsCalendarInterface::updateCalendar public function Given an array of RoomEvents the calendar is updated with regards to the events that are relevant to the Unit this calendar refers to 1
UnitPricingCalendarInterface::applyPriceModifiers public function Apply price modifiers to base price. 1
UnitPricingCalendarInterface::calculatePrice public function Given a date range determine the cost of the room over that period. 1
UnitPricingCalendarInterface::calculatePricingEvents public function Get a set of PricingEvent between start_date and end_date filtered by days. 1