function gathercontent_entity_base_field_info in GatherContent 8.5
Same name and namespace in other branches
- 8.3 gathercontent.module \gathercontent_entity_base_field_info()
- 8.4 gathercontent.module \gathercontent_entity_base_field_info()
Implements hook_entity_base_field_info().
Add a 'GC mapping ID' and 'GC ID fields' base field to all node types.
File
- ./
gathercontent.module, line 23 - Main module file for GatherContent module.
Code
function gathercontent_entity_base_field_info(EntityTypeInterface $entity_type) {
$fields = [];
if ($entity_type
->id() === 'file') {
$fields['gc_file_id'] = BaseFieldDefinition::create('string')
->setLabel(t('GC ID'))
->setDescription(t('The ID of GatherContent content.'))
->setReadOnly(TRUE);
}
return $fields;
}