You are here

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

Property callback for the Entity Metadata framework.

1 string reference to 'rooms_options_property_info_callback'
rooms_field_info in ./rooms.module
Implements hook_field_info().

File

./rooms.module, line 549
Provides basic underlying functionality and configuration options used by all Rooms modules

Code

function rooms_options_property_info_callback(&$info, $entity_type, $field, $instance, $field_type) {

  // Apply the default.
  entity_metadata_field_default_property_callback($info, $entity_type, $field, $instance, $field_type);

  // Finally add in instance specific property info.
  $name = $field['field_name'];
  $property =& $info[$entity_type]['bundles'][$instance['bundle']]['properties'][$name];
  $property['type'] = $field['cardinality'] != 1 ? 'list<rooms_options>' : 'rooms_options';
  $property['property info'] = rooms_options_data_property_info('Rooms options');
  $property['getter callback'] = 'entity_metadata_field_verbatim_get';
  $property['setter callback'] = 'entity_metadata_field_verbatim_set';
}