3 namespace Drupal\search_api_synonym;
5 use Drupal\views\EntityViewsData;
8 * Provides Views data for Synonym entities.
10 class SynonymViewsData extends EntityViewsData {
14 public function getViewsData() {
15 $data = parent::getViewsData();
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';
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.');
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.');
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.');
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.');
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.');
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.'),
42 'id' => 'date_fulldate',
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.'),
51 'id' => 'date_year_month',
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.'),
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).'),
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).'),
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).'),
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.');
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.'),
99 'id' => 'date_fulldate',
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.'),
107 'field' => 'changed',
108 'id' => 'date_year_month',
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.'),
116 'field' => 'changed',
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).'),
125 'field' => 'changed',
126 'id' => 'date_month',
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).'),
134 'field' => 'changed',
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).'),
143 'field' => 'changed',
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';
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');