function hook_rooms_availability_update in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7
Notifies subscribing modules of changes to the availability calendar. This allows modules to react to changes.
Parameters
array $response - The response generated from the availability: calendar on a per-event basis Response 100 - Event blocked Response 200 - Event update Response 300 - Wrong unit
array $events - The events that were sent to the availability: calendar to be changed.
1 invocation of hook_rooms_availability_update()
- UnitCalendar::updateCalendar in modules/
rooms_availability/ includes/ rooms_availability.unit_calendar.inc - Given an array of RoomEvents the calendar is updated with regards to the events that are relevant to the Unit this calendar refers to
File
- modules/
rooms_availability/ rooms_availability.api.php, line 23 - 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_availability_update($response, $events) {
foreach ($events as $event) {
if ($response[$event->id] == ROOMS_UPDATED) {
$unit_affected = rooms_unit_load($event->unit_id);
}
}
}