rooms_booking_manager.api.php in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.
File
modules/rooms_booking_manager/rooms_booking_manager.api.phpView source
<?php
/**
* @file
* This file contains no working PHP code; it exists to provide additional
* documentation for doxygen as well as to document hooks in the standard
* Drupal manner.
*/
/**
* This hook allows to modify the search results before being rendered to the
* end user.
*
* @param array $units_per_type
* Array containing the units from the search results. Keyed by unit type and
* price.
* @param DateTime $start_date
* The booking start date.
* @param DateTime $end_date
* The booking end date.
* @param array $booking_parameters
* Array containing the parameters entered in the search form.
*/
function hook_rooms_booking_results_alter(&$units_per_type, $start_date, $end_date, $booking_parameters) {
// Remove form results all unit of type villa and price greater than 200.
foreach ($units_per_type['villa'] as $key => $value) {
if ($key > 200) {
unset($units_per_type['villa'][$key]);
}
}
}
/**
* Allows you to change the line item before it is added to the cart - this gives
* lots of flexibility to add information to a line item or change the label.
*
*
* @param $line_item
* @param array $context
*/
function hook_rooms_create_line_item_alter(&$line_item, $context) {
// No example.
}
Functions
Name | Description |
---|---|
hook_rooms_booking_results_alter | This hook allows to modify the search results before being rendered to the end user. |
hook_rooms_create_line_item_alter | Allows you to change the line item before it is added to the cart - this gives lots of flexibility to add information to a line item or change the label. |