You are here

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

Fetches a bookable unit object.

Parameters

int $unit_id: Integer specifying the unit id.

bool $reset: A boolean indicating whether the internal cache should be reset.

Return value

RoomsUnit|false A fully-loaded $unit object or FALSE if it cannot be loaded.

See also

rooms_unit_load_multiple()

24 calls to rooms_unit_load()
AvailabilityAgent::checkAvailabilityForUnit in modules/rooms_booking/includes/rooms_booking.availability_agent.inc
Returns availability for a specific unit.
AvailabilityAgent::getUnitsByPriceType in modules/rooms_booking/includes/rooms_booking.availability_agent.inc
Returns the units array in a specific format based on price.
AvailabilityAgentDateFilter::applyFilter in modules/rooms_booking/includes/rooms_booking.availability_agent_filter.inc
Applies the filter operation to the units in the filter.
AvailabilityAgentSingleUnitFilter::applyFilter in modules/rooms_booking/includes/rooms_booking.availability_agent_filter.inc
Applies the filter operation to the units in the filter.
book_unit_form_submit in modules/rooms_booking_manager/rooms_booking_manager.module
Submit callback for book_unit_form form.

... See full list

File

modules/rooms_unit/rooms_unit.module, line 411
Manage units - Units are things that can be booked on a nightly basis (e.g. rooms - but also villas bungalows, etc).

Code

function rooms_unit_load($unit_id, $reset = FALSE) {
  $units = rooms_unit_load_multiple(array(
    $unit_id,
  ), array(), $reset);
  return reset($units);
}