You are here

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

This hook allows to modify the search results before being rendered to the end user.

Parameters

array $units_per_type: Array containing the units from the search results. Keyed by unit type and price.

DateTime $start_date: The booking start date.

DateTime $end_date: The booking end date.

array $booking_parameters: Array containing the parameters entered in the search form.

1 invocation of hook_rooms_booking_results_alter()
rooms_booking_manager_results_page in modules/rooms_booking_manager/rooms_booking_manager.module
Constructs the booking results page following an availability search.

File

modules/rooms_booking_manager/rooms_booking_manager.api.php, line 24
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.

Code

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]);
    }
  }
}