function rooms_booking_manager_update_7005 in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7
Adds "Booking Children Ages" field to the rooms_booking_manager_line_item.
File
- modules/
rooms_booking_manager/ rooms_booking_manager.install, line 325 - Install for Rooms Booking Manager module
Code
function rooms_booking_manager_update_7005() {
$field = array(
'field_name' => 'rooms_booking_children_ages',
'label' => t('Booking Children Ages'),
'cardinality' => -1,
'type' => 'number_integer',
'module' => 'number',
'active' => 1,
'locked' => 1,
'settings' => array(
'size' => 8,
'max_length' => 10,
'text_processing' => 0,
),
);
field_create_field($field);
$instance = array(
'field_name' => 'rooms_booking_children_ages',
'label' => t('Booking Children Ages'),
'entity_type' => 'commerce_line_item',
'bundle' => 'rooms_booking',
'required' => FALSE,
'settings' => array(
'size' => 8,
'max_length' => 10,
'text_processing' => 0,
),
'widget' => array(
'type' => 'text_textfield',
),
'display' => array(
'default' => array(
'label' => 'above',
'module' => 'number',
'settings' => array(
'decimal_separator' => '.',
'prefix_suffix' => TRUE,
'scale' => 0,
'thousand_separator' => ' ',
),
'type' => 'number_integer',
'weight' => 13,
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
);
field_create_instance($instance);
}