function rooms_unit_update_7006 in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7
Adds max and min sleeps for Bookable Unit Types.
File
- modules/
rooms_unit/ rooms_unit.install, line 495 - Sets up the base table for our entity and a table to store information about the entity types.
Code
function rooms_unit_update_7006() {
foreach (rooms_unit_types_ids() as $type => $label) {
$unit_type = rooms_unit_type_load($type);
$unit_type->data = array(
'base_price' => $unit_type->data['base_price'],
'min_sleeps' => $unit_type->data['sleeps'],
'max_sleeps' => $unit_type->data['sleeps'],
'min_children' => $unit_type->data['children_sleeps'],
'max_children' => $unit_type->data['children_sleeps'],
'rooms_description_source' => $unit_type->data['$unit_type->data'],
);
rooms_unit_type_save($unit_type);
}
}