class UcOrderProductMetadataController in Ubercart 7.3
Metadata controller class for uc_order_product entities.
Hierarchy
Expanded class hierarchy of UcOrderProductMetadataController
1 string reference to 'UcOrderProductMetadataController'
- uc_order_entity_info in uc_order/
uc_order.module - Implements hook_entity_info().
File
- uc_order/
uc_order.info.inc, line 121 - Entity Metadata hooks.
View source
class UcOrderProductMetadataController extends EntityDefaultMetadataController {
public function entityPropertyInfo() {
$props = parent::entityPropertyInfo();
// Copy the descriptions from the schema. Drupal discards this information, so we have to
// call uc_order_schema() directly.
module_load_include('install', 'uc_order', 'uc_order');
$schema = uc_order_schema();
foreach ($schema['uc_order_products']['fields'] as $name => $info) {
if (is_array($props['uc_order_product']['properties'][$name]) && !empty($info['description'])) {
$props['uc_order_product']['properties'][$name]['description'] = $info['description'];
}
}
// Add the 'node' property.
$props['uc_order_product']['properties']['node'] = array(
'type' => 'node',
'label' => t('Node'),
'description' => t('The node representing the product.'),
'getter callback' => 'uc_order_product_node_property_get',
'setter callback' => 'uc_order_product_node_property_set',
);
return $props;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityDefaultMetadataController:: |
protected | property | ||
EntityDefaultMetadataController:: |
public static | function | A options list callback returning all bundles for an entity type. | |
EntityDefaultMetadataController:: |
protected | function | Return a set of properties for an entity based on the schema definition | |
EntityDefaultMetadataController:: |
public | function | ||
UcOrderProductMetadataController:: |
public | function |
Overrides EntityDefaultMetadataController:: |