Added the Search API Synonym module to deal specifically with licence and license...
[yaffs-website] / web / modules / contrib / search_api_synonym / src / SynonymViewsData.php
1 <?php
2
3 namespace Drupal\search_api_synonym;
4
5 use Drupal\views\EntityViewsData;
6
7 /**
8  * Provides Views data for Synonym entities.
9  */
10 class SynonymViewsData extends EntityViewsData {
11   /**
12    * {@inheritdoc}
13    */
14   public function getViewsData() {
15     $data = parent::getViewsData();
16
17
18     $data['search_api_synonym_field_data']['table']['base']['help'] = $this->t('Synonyms managed by Search API Synonyms module.');
19     $data['search_api_synonym_field_data']['table']['base']['defaults']['field'] = 'word';
20     $data['search_api_synonym_field_data']['table']['wizard_id'] = 'synonym';
21
22     $data['search_api_synonym_field_data']['sid']['title'] = $this->t('Synonym ID');
23     $data['search_api_synonym_field_data']['sid']['help'] = $this->t('The unique id of the synonym entity.');
24
25     $data['search_api_synonym_field_data']['word']['title'] = $this->t('Word');
26     $data['search_api_synonym_field_data']['word']['help'] = $this->t('The word we are defining synonyms for.');
27
28     $data['search_api_synonym_field_data']['synonyms']['title'] = $this->t('Synonyms');
29     $data['search_api_synonym_field_data']['synonyms']['help'] = $this->t('The synonyms to the word.');
30
31     $data['search_api_synonym_field_data']['type']['title'] = $this->t('Type');
32     $data['search_api_synonym_field_data']['type']['help'] = $this->t('The type of synonym. Either synonym or spelling error.');
33
34     $data['search_api_synonym_field_data']['created']['title'] = $this->t('Create date');
35     $data['search_api_synonym_field_data']['created']['help'] = $this->t('Date and time of when the synonym was created.');
36
37     $data['search_api_synonym_field_data']['created_fulldata'] = [
38       'title' => $this->t('Created date'),
39       'help' => $this->t('Date in the form of CCYYMMDD.'),
40       'argument' => [
41         'field' => 'created',
42         'id' => 'date_fulldate',
43       ],
44     ];
45
46     $data['search_api_synonym_field_data']['created_year_month'] = [
47       'title' => $this->t('Created year + month'),
48       'help' => $this->t('Date in the form of YYYYMM.'),
49       'argument' => [
50         'field' => 'created',
51         'id' => 'date_year_month',
52       ],
53     ];
54
55     $data['search_api_synonym_field_data']['created_year'] = [
56       'title' => $this->t('Created year'),
57       'help' => $this->t('Date in the form of YYYY.'),
58       'argument' => [
59         'field' => 'created',
60         'id' => 'date_year',
61       ],
62     ];
63
64     $data['search_api_synonym_field_data']['created_month'] = [
65       'title' => $this->t('Created month'),
66       'help' => $this->t('Date in the form of MM (01 - 12).'),
67       'argument' => [
68         'field' => 'created',
69         'id' => 'date_month',
70       ],
71     ];
72
73     $data['search_api_synonym_field_data']['created_day'] = [
74       'title' => $this->t('Created day'),
75       'help' => $this->t('Date in the form of DD (01 - 31).'),
76       'argument' => [
77         'field' => 'created',
78         'id' => 'date_day',
79       ],
80     ];
81
82     $data['search_api_synonym_field_data']['created_week'] = [
83       'title' => $this->t('Created week'),
84       'help' => $this->t('Date in the form of WW (01 - 53).'),
85       'argument' => [
86         'field' => 'created',
87         'id' => 'date_week',
88       ],
89     ];
90
91     $data['search_api_synonym_field_data']['changed']['title'] = $this->t('Updated date');
92     $data['search_api_synonym_field_data']['changed']['help'] = $this->t('Date and time of when the synonym was last updated.');
93
94     $data['search_api_synonym_field_data']['changed_fulldata'] = [
95       'title' => $this->t('Changed date'),
96       'help' => $this->t('Date in the form of CCYYMMDD.'),
97       'argument' => [
98         'field' => 'changed',
99         'id' => 'date_fulldate',
100       ],
101     ];
102
103     $data['search_api_synonym_field_data']['changed_year_month'] = [
104       'title' => $this->t('Changed year + month'),
105       'help' => $this->t('Date in the form of YYYYMM.'),
106       'argument' => [
107         'field' => 'changed',
108         'id' => 'date_year_month',
109       ],
110     ];
111
112     $data['search_api_synonym_field_data']['changed_year'] = [
113       'title' => $this->t('Changed year'),
114       'help' => $this->t('Date in the form of YYYY.'),
115       'argument' => [
116         'field' => 'changed',
117         'id' => 'date_year',
118       ],
119     ];
120
121     $data['search_api_synonym_field_data']['changed_month'] = [
122       'title' => $this->t('Changed month'),
123       'help' => $this->t('Date in the form of MM (01 - 12).'),
124       'argument' => [
125         'field' => 'changed',
126         'id' => 'date_month',
127       ],
128     ];
129
130     $data['search_api_synonym_field_data']['changed_day'] = [
131       'title' => $this->t('Changed day'),
132       'help' => $this->t('Date in the form of DD (01 - 31).'),
133       'argument' => [
134         'field' => 'changed',
135         'id' => 'date_day',
136       ],
137     ];
138
139     $data['search_api_synonym_field_data']['changed_week'] = [
140       'title' => $this->t('Changed week'),
141       'help' => $this->t('Date in the form of WW (01 - 53).'),
142       'argument' => [
143         'field' => 'changed',
144         'id' => 'date_week',
145       ],
146     ];
147
148     $data['search_api_synonym_field_data']['status']['title'] = $this->t('Active status');
149     $data['search_api_synonym_field_data']['status']['help'] = $this->t('Whether the synonym is active and used by search engines or is it no active.');
150     $data['search_api_synonym_field_data']['status']['filter']['label'] = $this->t('Active synonym status');
151     $data['search_api_synonym_field_data']['status']['filter']['type'] = 'yes-no';
152
153     $data['search_api_synonym_field_data']['uid']['title'] = $this->t('Author uid');
154     $data['search_api_synonym_field_data']['uid']['help'] = $this->t('If you need more fields than the uid add the synonym: author relationship');
155     $data['search_api_synonym_field_data']['uid']['relationship']['title'] = $this->t('Author');
156     $data['search_api_synonym_field_data']['uid']['relationship']['help'] = $this->t('The User ID of the synonym\'s author.');
157     $data['search_api_synonym_field_data']['uid']['relationship']['label'] = $this->t('author');
158
159     return $data;
160   }
161
162 }