-
Notifications
You must be signed in to change notification settings - Fork 1
/
farm_arable.views.inc
146 lines (127 loc) · 2.99 KB
/
farm_arable.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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
/**
* @file
* Contains views hooks for farm_arable.module
*/
/**
* Implements hook_views_data().
*/
function farm_arable_views_data() {
$data = [];
// Add views data for arable location info.
$data['farm_arable_locations']['table']['group'] = t('Arable');
$data['farm_arable_locations']['table']['base'] = [
'title' => t('Arable locations'),
'help' => t('Arable locations provided by the Arable API.'),
'query_id' => 'arable_locations',
];
$data['farm_arable_locations']['name'] = [
'title' => t('Location name'),
'field' => [
'id' => 'standard',
],
];
$data['farm_arable_locations']['id'] = [
'title' => t('Location id'),
'field' => [
'id' => 'standard',
],
];
$data['farm_arable_locations']['connected'] = [
'title' => t('Connected'),
'field' => [
'id' => 'boolean',
],
'filter' => [
'id' => 'boolean',
],
];
$data['farm_arable_locations']['data_stream_id'] = [
'title' => t('Data stream ID'),
'description' => t('ID of the associated data stream'),
'field' => [
'id' => 'standard',
],
];
$data['farm_arable_locations']['state'] = [
'title' => t('State'),
'field' => [
'id' => 'standard',
],
'filter' => [
'id' => 'arable_location_state',
],
];
$data['farm_arable_locations']['archived'] = [
'title' => t('Archived'),
'field' => [
'id' => 'boolean',
],
'filter' => [
'id' => 'boolean',
],
];
$data['farm_arable_locations']['start_date'] = [
'title' => t('Start date'),
'field' => [
'id' => 'date',
],
];
$data['farm_arable_locations']['end_date'] = [
'title' => t('End date'),
'field' => [
'id' => 'date',
],
];
$data['farm_arable_locations']['last_post'] = [
'title' => t('Last post'),
'field' => [
'id' => 'date',
],
];
$data['farm_arable_locations']['latitude'] = [
'title' => t('Latitude'),
'field' => [
'id' => 'numeric',
],
];
$data['farm_arable_locations']['longitude'] = [
'title' => t('Longitude'),
'field' => [
'id' => 'numeric',
],
];
$data['farm_arable_daily']['table']['group'] = t('Arable');
$data['farm_arable_daily']['table']['base'] = [
'title' => t('Arable daily'),
'help' => t('Arable daily data provided by the Arable API.'),
'query_id' => 'arable',
];
$data['farm_arable_daily']['time'] = [
'title' => t('Time'),
'help' => t('Timestamp with timezone'),
'field' => [
'id' => 'date',
],
'filter' => [
'id' => 'date'
]
];
$data['farm_arable_daily']['meant'] = [
'title' => t('Mean temperature'),
'help' => t('Daily mean temperature'),
'field' => [
'id' => 'numeric',
'float' => TRUE,
],
];
$data['farm_arable_daily']['mint'] = [
'title' => t('Minimum temperature'),
'help' => t('Daily minimum temperature'),
'field' => [
'id' => 'numeric',
'float' => TRUE,
],
];
return $data;
}