-
Notifications
You must be signed in to change notification settings - Fork 0
/
uc_node_checkout.views.inc
56 lines (49 loc) · 1.57 KB
/
uc_node_checkout.views.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* Views integration for uc_node_checkout module.
*
* Creates a relationship between the created node and the associated order
* line number.
*/
/**
* Implements hook_views_data().
*/
function uc_node_checkout_views_data() {
// Definition for the uc_node_checkout_order_products bridge table.
$data['uc_node_checkout_order_products']['table']['group'] = t('UC Node Checkout');
$data['uc_node_checkout_order_products']['table']['join'] = array(
'node' => array(
'left_field' => 'nid',
'field' => 'nid',
'type' => 'LEFT',
),
'uc_order_products' => array(
'left_field' => 'order_product_id',
'field' => 'order_product_id',
'type' => 'LEFT',
),
);
$data['uc_node_checkout_order_products']['order_product_id'] = array(
'title' => t('UC Node Checkout order product'),
'help' => t('Relate a purchased node to its UC Node Checkout order product.'),
'relationship' => array(
'handler' => 'views_handler_relationship',
'base' => 'uc_order_products',
'base field' => 'order_product_id',
'field' => 'order_product_id',
'label' => t('UC Node Checkout order product'),
),
);
$data['uc_node_checkout_order_products']['nid'] = array(
'title' => t('UC Node Checkout node'),
'help' => t('Relate an order product to UC Node Checkout created node.'),
'relationship' => array(
'handler' => 'views_handler_relationship',
'base' => 'node',
'base field' => 'nid',
'field' => 'nid',
'label' => t('UC Node Checkout node'),
),
);
return $data;
}