synonyms.module in Synonyms 8
Same filename and directory in other branches
Provide synonyms feature for content entities.
File
synonyms.moduleView source
<?php
/**
* @file
* Provide synonyms feature for content entities.
*/
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\ContentEntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
/**
* Implements hook_entity_base_field_info().
*/
function synonyms_entity_base_field_info(EntityTypeInterface $entity_type) {
if ($entity_type instanceof ContentEntityTypeInterface) {
$fields = [];
$fields['synonyms'] = BaseFieldDefinition::create('string')
->setLabel(t('Entity synonyms'))
->setDescription(t('A list of known entity synonyms.'))
->setComputed(TRUE)
->setClass('\\Drupal\\synonyms\\Plugin\\SynonymsFieldItemList');
return $fields;
}
}
Functions
Name | Description |
---|---|
synonyms_entity_base_field_info | Implements hook_entity_base_field_info(). |