You are here

rooms_availability.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_availability/rooms_availability.api.php
View 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.
 */

/**
 * Notifies subscribing modules of changes to the availability
 * calendar. This allows modules to react to changes.
 *
 * @param 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
 *
 * @param array $events - The events that were sent to the availability
 * calendar to be changed.
 */
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);
    }
  }
}

Functions

Namesort descending Description
hook_rooms_availability_update Notifies subscribing modules of changes to the availability calendar. This allows modules to react to changes.