-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnodeviewcount.views.inc
More file actions
87 lines (84 loc) · 1.83 KB
/
nodeviewcount.views.inc
File metadata and controls
87 lines (84 loc) · 1.83 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/**
* @file
* Provide views data for nodeviewcount.module.
*/
/**
* Implements hook_views_data().
*/
function nodeviewcount_views_data() {
$data['nodeviewcount']['table']['group'] = t('Node count');
$data['nodeviewcount']['table']['base'] = [
'field' => 'nid',
'title' => t('Node view count'),
'help' => t('This table is containing the data about count view of node.'),
'weight' => -10,
];
$data['nodeviewcount']['table']['join'] = [
'node_field_data' => [
'left_field' => 'nid',
'field' => 'nid',
],
];
$data['nodeviewcount']['nid'] = [
'title' => t('Node id'),
'help' => t('Node id.'),
'relationship' => [
'base' => 'node_field_data',
'base field' => 'nid',
'id' => 'standard',
'label' => t('Node View Count Node'),
],
'field' => [
'id' => 'numeric',
'click sortable' => TRUE,
],
'filter' => [
'id' => 'numeric',
],
'sort' => [
'id' => 'standard',
],
'argument' => [
'id' => 'numeric',
],
];
$data['nodeviewcount']['uid'] = [
'title' => t('Who view'),
'help' => t('Who view of node.'),
'relationship' => [
'base' => 'users_field_data',
'base field' => 'uid',
'id' => 'standard',
'label' => t('Node View Count User'),
],
'field' => [
'id' => 'numeric',
'click sortable' => TRUE,
],
'filter' => [
'id' => 'numeric',
],
'sort' => [
'id' => 'standard',
],
'argument' => [
'id' => 'numeric',
],
];
$data['nodeviewcount']['timestamp'] = [
'title' => t('Timestamp'),
'help' => t('When user view of node.'),
'field' => [
'id' => 'date',
'click sortable' => TRUE,
],
'filter' => [
'id' => 'date',
],
'sort' => [
'id' => 'date',
],
];
return $data;
}