You are here

function physical_weight_property_info_callback in Physical Fields 7

Callback to alter the property info of weight fields.

See also

physical_field_info().

1 string reference to 'physical_weight_property_info_callback'
physical_field_info in ./physical.module
Implements hook_field_info().

File

./physical.module, line 1001
Defines fields (e.g. weight and dimensions) to support describing the physical attributes of entities.

Code

function physical_weight_property_info_callback(&$info, $entity_type, $field, $instance, $field_type) {
  $name = $field['field_name'];
  $property =& $info[$entity_type]['bundles'][$instance['bundle']]['properties'][$name];
  $property['type'] = $field['cardinality'] != 1 ? 'list<physical_weight>' : 'physical_weight';
  $property['getter callback'] = 'entity_metadata_field_verbatim_get';
  $property['setter callback'] = 'entity_metadata_field_verbatim_set';
  $property['auto creation'] = 'physical_weight_field_data_auto_creation';
  $property['property info'] = physical_weight_field_data_property_info();
  unset($property['query callback']);
}