You are here

function commerce_file_field_property_info_callback in Commerce File 7

Callback to alter the property info of price fields.

See also

commerce_file_field_info().

1 string reference to 'commerce_file_field_property_info_callback'
commerce_file_field_info in includes/commerce_file.field.inc
Implements hook_field_info().

File

includes/commerce_file.field.inc, line 634
Implement an commerce_file field, based on the file module's file field.

Code

function commerce_file_field_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<commerce_file>' : 'commerce_file';
  $property['getter callback'] = 'entity_metadata_field_verbatim_get';
  $property['setter callback'] = 'entity_metadata_field_verbatim_set';
  $property['validation callback'] = 'commerce_file_field_entity_metadata_validate_item';
  $property['auto creation'] = 'commerce_file_field_data_auto_creation';
  $property['property info'] = commerce_file_field_data_property_info($name);
  unset($property['query callback']);
}