comparison core/modules/taxonomy/src/TermViewsData.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
34 $data['taxonomy_term_field_data']['tid']['argument']['zero is null'] = TRUE; 34 $data['taxonomy_term_field_data']['tid']['argument']['zero is null'] = TRUE;
35 35
36 $data['taxonomy_term_field_data']['tid']['filter']['id'] = 'taxonomy_index_tid'; 36 $data['taxonomy_term_field_data']['tid']['filter']['id'] = 'taxonomy_index_tid';
37 $data['taxonomy_term_field_data']['tid']['filter']['title'] = $this->t('Term'); 37 $data['taxonomy_term_field_data']['tid']['filter']['title'] = $this->t('Term');
38 $data['taxonomy_term_field_data']['tid']['filter']['help'] = $this->t('Taxonomy term chosen from autocomplete or select widget.'); 38 $data['taxonomy_term_field_data']['tid']['filter']['help'] = $this->t('Taxonomy term chosen from autocomplete or select widget.');
39 $data['taxonomy_term_field_data']['tid']['filter']['hierarchy table'] = 'taxonomy_term_hierarchy'; 39 $data['taxonomy_term_field_data']['tid']['filter']['hierarchy table'] = 'taxonomy_term__parent';
40 $data['taxonomy_term_field_data']['tid']['filter']['numeric'] = TRUE; 40 $data['taxonomy_term_field_data']['tid']['filter']['numeric'] = TRUE;
41 41
42 $data['taxonomy_term_field_data']['tid_raw'] = [ 42 $data['taxonomy_term_field_data']['tid_raw'] = [
43 'title' => $this->t('Term ID'), 43 'title' => $this->t('Term ID'),
44 'help' => $this->t('The tid of a taxonomy term.'), 44 'help' => $this->t('The tid of a taxonomy term.'),
59 'outer field' => 'taxonomy_term_field_data.tid', 59 'outer field' => 'taxonomy_term_field_data.tid',
60 'argument table' => 'taxonomy_term_field_data', 60 'argument table' => 'taxonomy_term_field_data',
61 'argument field' => 'tid', 61 'argument field' => 'tid',
62 'base' => 'node_field_data', 62 'base' => 'node_field_data',
63 'field' => 'nid', 63 'field' => 'nid',
64 'relationship' => 'node_field_data:term_node_tid' 64 'relationship' => 'node_field_data:term_node_tid',
65 ], 65 ],
66 ]; 66 ];
67 67
68 $data['taxonomy_term_field_data']['vid']['help'] = $this->t('Filter the results of "Taxonomy: Term" to a particular vocabulary.'); 68 $data['taxonomy_term_field_data']['vid']['help'] = $this->t('Filter the results of "Taxonomy: Term" to a particular vocabulary.');
69 unset($data['taxonomy_term_field_data']['vid']['field']); 69 $data['taxonomy_term_field_data']['vid']['field']['help'] = t('The vocabulary name.');
70 $data['taxonomy_term_field_data']['vid']['argument']['id'] = 'vocabulary_vid'; 70 $data['taxonomy_term_field_data']['vid']['argument']['id'] = 'vocabulary_vid';
71 unset($data['taxonomy_term_field_data']['vid']['sort']); 71 unset($data['taxonomy_term_field_data']['vid']['sort']);
72 72
73 $data['taxonomy_term_field_data']['name']['field']['id'] = 'term_name'; 73 $data['taxonomy_term_field_data']['name']['field']['id'] = 'term_name';
74 $data['taxonomy_term_field_data']['name']['argument']['many to one'] = TRUE; 74 $data['taxonomy_term_field_data']['name']['argument']['many to one'] = TRUE;
131 'field' => 'changed', 131 'field' => 'changed',
132 'id' => 'date_week', 132 'id' => 'date_week',
133 ], 133 ],
134 ]; 134 ];
135 135
136 $data['taxonomy_index']['table']['group'] = $this->t('Taxonomy term'); 136 $data['taxonomy_index']['table']['group'] = $this->t('Taxonomy term');
137 137
138 $data['taxonomy_index']['table']['join'] = [ 138 $data['taxonomy_index']['table']['join'] = [
139 'taxonomy_term_field_data' => [ 139 'taxonomy_term_field_data' => [
140 // links directly to taxonomy_term_field_data via tid 140 // links directly to taxonomy_term_field_data via tid
141 'left_field' => 'tid', 141 'left_field' => 'tid',
144 'node_field_data' => [ 144 'node_field_data' => [
145 // links directly to node via nid 145 // links directly to node via nid
146 'left_field' => 'nid', 146 'left_field' => 'nid',
147 'field' => 'nid', 147 'field' => 'nid',
148 ], 148 ],
149 'taxonomy_term_hierarchy' => [ 149 'taxonomy_term__parent' => [
150 'left_field' => 'tid', 150 'left_field' => 'entity_id',
151 'field' => 'tid', 151 'field' => 'tid',
152 ], 152 ],
153 ]; 153 ];
154 154
155 $data['taxonomy_index']['nid'] = [ 155 $data['taxonomy_index']['nid'] = [
179 'skip base' => 'taxonomy_term_field_data', 179 'skip base' => 'taxonomy_term_field_data',
180 ], 180 ],
181 'filter' => [ 181 'filter' => [
182 'title' => $this->t('Has taxonomy term'), 182 'title' => $this->t('Has taxonomy term'),
183 'id' => 'taxonomy_index_tid', 183 'id' => 'taxonomy_index_tid',
184 'hierarchy table' => 'taxonomy_term_hierarchy', 184 'hierarchy table' => 'taxonomy_term__parent',
185 'numeric' => TRUE, 185 'numeric' => TRUE,
186 'skip base' => 'taxonomy_term_field_data', 186 'skip base' => 'taxonomy_term_field_data',
187 'allow empty' => TRUE, 187 'allow empty' => TRUE,
188 ], 188 ],
189 ]; 189 ];
214 214
215 $data['taxonomy_index']['created'] = [ 215 $data['taxonomy_index']['created'] = [
216 'title' => $this->t('Post date'), 216 'title' => $this->t('Post date'),
217 'help' => $this->t('The date the content related to a term was posted.'), 217 'help' => $this->t('The date the content related to a term was posted.'),
218 'sort' => [ 218 'sort' => [
219 'id' => 'date'
220 ],
221 'filter' => [
222 'id' => 'date', 219 'id' => 'date',
223 ], 220 ],
224 ]; 221 'filter' => [
225 222 'id' => 'date',
226 $data['taxonomy_term_hierarchy']['table']['group'] = $this->t('Taxonomy term'); 223 ],
227 $data['taxonomy_term_hierarchy']['table']['provider'] = 'taxonomy'; 224 ];
228 225
229 $data['taxonomy_term_hierarchy']['table']['join'] = [ 226 // Link to self through left.parent = right.tid (going down in depth).
230 'taxonomy_term_hierarchy' => [ 227 $data['taxonomy_term__parent']['table']['join']['taxonomy_term__parent'] = [
231 // Link to self through left.parent = right.tid (going down in depth). 228 'left_field' => 'entity_id',
232 'left_field' => 'tid', 229 'field' => 'parent_target_id',
233 'field' => 'parent', 230 ];
234 ], 231
235 'taxonomy_term_field_data' => [ 232 $data['taxonomy_term__parent']['parent_target_id']['help'] = $this->t('The parent term of the term. This can produce duplicate entries if you are using a vocabulary that allows multiple parents.');
236 // Link directly to taxonomy_term_field_data via tid. 233 $data['taxonomy_term__parent']['parent_target_id']['relationship']['label'] = $this->t('Parent');
237 'left_field' => 'tid', 234 $data['taxonomy_term__parent']['parent_target_id']['argument']['id'] = 'taxonomy';
238 'field' => 'tid',
239 ],
240 ];
241
242 $data['taxonomy_term_hierarchy']['parent'] = [
243 'title' => $this->t('Parent term'),
244 'help' => $this->t('The parent term of the term. This can produce duplicate entries if you are using a vocabulary that allows multiple parents.'),
245 'relationship' => [
246 'base' => 'taxonomy_term_field_data',
247 'field' => 'parent',
248 'label' => $this->t('Parent'),
249 'id' => 'standard',
250 ],
251 'filter' => [
252 'help' => $this->t('Filter the results of "Taxonomy: Term" by the parent pid.'),
253 'id' => 'numeric',
254 ],
255 'argument' => [
256 'help' => $this->t('The parent term of the term.'),
257 'id' => 'taxonomy',
258 ],
259 ];
260 235
261 return $data; 236 return $data;
262 } 237 }
263 238
264 } 239 }