class SynonymViewsData in Search API Synonym 8
Provides Views data for Synonym entities.
Hierarchy
- class \Drupal\views\EntityViewsData implements EntityHandlerInterface, EntityViewsDataInterface uses DeprecatedServicePropertyTrait, StringTranslationTrait
- class \Drupal\search_api_synonym\SynonymViewsData
Expanded class hierarchy of SynonymViewsData
File
- src/
SynonymViewsData.php, line 10
Namespace
Drupal\search_api_synonymView source
class SynonymViewsData extends EntityViewsData {
/**
* {@inheritdoc}
*/
public function getViewsData() {
$data = parent::getViewsData();
$data['search_api_synonym_field_data']['table']['base']['help'] = $this
->t('Synonyms managed by Search API Synonyms module.');
$data['search_api_synonym_field_data']['table']['base']['defaults']['field'] = 'word';
$data['search_api_synonym_field_data']['table']['wizard_id'] = 'synonym';
$data['search_api_synonym_field_data']['sid']['title'] = $this
->t('Synonym ID');
$data['search_api_synonym_field_data']['sid']['help'] = $this
->t('The unique id of the synonym entity.');
$data['search_api_synonym_field_data']['word']['title'] = $this
->t('Word');
$data['search_api_synonym_field_data']['word']['help'] = $this
->t('The word we are defining synonyms for.');
$data['search_api_synonym_field_data']['synonyms']['title'] = $this
->t('Synonyms');
$data['search_api_synonym_field_data']['synonyms']['help'] = $this
->t('The synonyms to the word.');
$data['search_api_synonym_field_data']['type']['title'] = $this
->t('Type');
$data['search_api_synonym_field_data']['type']['help'] = $this
->t('The type of synonym. Either synonym or spelling error.');
$data['search_api_synonym_field_data']['created']['title'] = $this
->t('Create date');
$data['search_api_synonym_field_data']['created']['help'] = $this
->t('Date and time of when the synonym was created.');
$data['search_api_synonym_field_data']['created_fulldata'] = [
'title' => $this
->t('Created date'),
'help' => $this
->t('Date in the form of CCYYMMDD.'),
'argument' => [
'field' => 'created',
'id' => 'date_fulldate',
],
];
$data['search_api_synonym_field_data']['created_year_month'] = [
'title' => $this
->t('Created year + month'),
'help' => $this
->t('Date in the form of YYYYMM.'),
'argument' => [
'field' => 'created',
'id' => 'date_year_month',
],
];
$data['search_api_synonym_field_data']['created_year'] = [
'title' => $this
->t('Created year'),
'help' => $this
->t('Date in the form of YYYY.'),
'argument' => [
'field' => 'created',
'id' => 'date_year',
],
];
$data['search_api_synonym_field_data']['created_month'] = [
'title' => $this
->t('Created month'),
'help' => $this
->t('Date in the form of MM (01 - 12).'),
'argument' => [
'field' => 'created',
'id' => 'date_month',
],
];
$data['search_api_synonym_field_data']['created_day'] = [
'title' => $this
->t('Created day'),
'help' => $this
->t('Date in the form of DD (01 - 31).'),
'argument' => [
'field' => 'created',
'id' => 'date_day',
],
];
$data['search_api_synonym_field_data']['created_week'] = [
'title' => $this
->t('Created week'),
'help' => $this
->t('Date in the form of WW (01 - 53).'),
'argument' => [
'field' => 'created',
'id' => 'date_week',
],
];
$data['search_api_synonym_field_data']['changed']['title'] = $this
->t('Updated date');
$data['search_api_synonym_field_data']['changed']['help'] = $this
->t('Date and time of when the synonym was last updated.');
$data['search_api_synonym_field_data']['changed_fulldata'] = [
'title' => $this
->t('Changed date'),
'help' => $this
->t('Date in the form of CCYYMMDD.'),
'argument' => [
'field' => 'changed',
'id' => 'date_fulldate',
],
];
$data['search_api_synonym_field_data']['changed_year_month'] = [
'title' => $this
->t('Changed year + month'),
'help' => $this
->t('Date in the form of YYYYMM.'),
'argument' => [
'field' => 'changed',
'id' => 'date_year_month',
],
];
$data['search_api_synonym_field_data']['changed_year'] = [
'title' => $this
->t('Changed year'),
'help' => $this
->t('Date in the form of YYYY.'),
'argument' => [
'field' => 'changed',
'id' => 'date_year',
],
];
$data['search_api_synonym_field_data']['changed_month'] = [
'title' => $this
->t('Changed month'),
'help' => $this
->t('Date in the form of MM (01 - 12).'),
'argument' => [
'field' => 'changed',
'id' => 'date_month',
],
];
$data['search_api_synonym_field_data']['changed_day'] = [
'title' => $this
->t('Changed day'),
'help' => $this
->t('Date in the form of DD (01 - 31).'),
'argument' => [
'field' => 'changed',
'id' => 'date_day',
],
];
$data['search_api_synonym_field_data']['changed_week'] = [
'title' => $this
->t('Changed week'),
'help' => $this
->t('Date in the form of WW (01 - 53).'),
'argument' => [
'field' => 'changed',
'id' => 'date_week',
],
];
$data['search_api_synonym_field_data']['status']['title'] = $this
->t('Active status');
$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.');
$data['search_api_synonym_field_data']['status']['filter']['label'] = $this
->t('Active synonym status');
$data['search_api_synonym_field_data']['status']['filter']['type'] = 'yes-no';
$data['search_api_synonym_field_data']['uid']['title'] = $this
->t('Author uid');
$data['search_api_synonym_field_data']['uid']['help'] = $this
->t('If you need more fields than the uid add the synonym: author relationship');
$data['search_api_synonym_field_data']['uid']['relationship']['title'] = $this
->t('Author');
$data['search_api_synonym_field_data']['uid']['relationship']['help'] = $this
->t('The User ID of the synonym\'s author.');
$data['search_api_synonym_field_data']['uid']['relationship']['label'] = $this
->t('author');
return $data;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeprecatedServicePropertyTrait:: |
public | function | Allows to access deprecated/removed properties. | |
EntityViewsData:: |
protected | property | ||
EntityViewsData:: |
protected | property | The entity field manager. | |
EntityViewsData:: |
protected | property | Entity type for this views data handler instance. | |
EntityViewsData:: |
protected | property | The entity type manager. | |
EntityViewsData:: |
protected | property | The field storage definitions for all base fields of the entity type. | |
EntityViewsData:: |
protected | property | The module handler. | |
EntityViewsData:: |
protected | property | The storage used for this entity type. | |
EntityViewsData:: |
protected | property | The translation manager. | |
EntityViewsData:: |
protected | function | Sets the entity links in case corresponding link templates exist. | |
EntityViewsData:: |
public static | function |
Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface:: |
|
EntityViewsData:: |
protected | function | Gets the field storage definitions. | |
EntityViewsData:: |
public | function |
Gets the table of an entity type to be used as base table in views. Overrides EntityViewsDataInterface:: |
|
EntityViewsData:: |
protected | function | Puts the views data for a single field onto the views data. | |
EntityViewsData:: |
protected | function | Provides the views data for a given data type and schema field. | |
EntityViewsData:: |
protected | function | Processes the views data for an entity reference field. | |
EntityViewsData:: |
protected | function | Processes the views data for a language field. | |
EntityViewsData:: |
protected | function | Processes the views data for a text field with formatting. | |
EntityViewsData:: |
protected | function | Processes the views data for a UUID field. | |
EntityViewsData:: |
public | function | Constructs an EntityViewsData object. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
SynonymViewsData:: |
public | function |
Returns views data for the entity type. Overrides EntityViewsData:: |