function commerce_product_reference_node_types in Commerce Core 7
Returns a list of all node types that contain a product reference field.
Return value
An array of node types, keyed by type.
2 calls to commerce_product_reference_node_types()
- commerce_product_reference_handler_filter_node_is_product_display::query in modules/
product_reference/ includes/ views/ handlers/ commerce_product_reference_handler_filter_node_is_product_display.inc - Add this filter to the query.
- commerce_product_reference_handler_filter_node_type::get_value_options in modules/
product_reference/ includes/ views/ handlers/ commerce_product_reference_handler_filter_node_type.inc - Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.
File
- modules/
product_reference/ commerce_product_reference.module, line 1517 - Defines a field type for referencing products from other entities.
Code
function commerce_product_reference_node_types() {
$list = array();
$types = node_type_get_types();
foreach (field_info_field_map() as $field_name => $field_stub) {
if ($field_stub['type'] == 'commerce_product_reference' && !empty($field_stub['bundles']['node'])) {
foreach ($field_stub['bundles']['node'] as $bundle) {
$list[$bundle] = $types[$bundle];
}
}
}
ksort($list);
return $list;
}