function filefield_paths_entity_base_field_info in File (Field) Paths 8
Implements hook_entity_base_field_info().
File
- ./
filefield_paths.module, line 25 - Contains core functions for the File (Field) Paths module.
Code
function filefield_paths_entity_base_field_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type) {
$fields = [];
if ($entity_type
->id() == 'file') {
$fields['origname'] = BaseFieldDefinition::create('string')
->setLabel(t('Original filename'))
->setDescription(t('Original name of the file with no path components.'));
}
return $fields;
}