function commerce_price_property_info_callback in Commerce Core 7
Callback to alter the property info of price fields.
See also
1 string reference to 'commerce_price_property_info_callback'
- commerce_price_field_info in modules/
price/ commerce_price.module - Implements hook_field_info().
File
- modules/
price/ commerce_price.module, line 769 - Defines the Price field with widgets and formatters used to add prices with currency codes to various Commerce entities.
Code
function commerce_price_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_price>' : 'commerce_price';
$property['getter callback'] = 'entity_metadata_field_verbatim_get';
$property['setter callback'] = 'entity_metadata_field_verbatim_set';
$property['auto creation'] = 'commerce_price_field_data_auto_creation';
$property['property info'] = commerce_price_field_data_property_info();
unset($property['query callback']);
}