Added files field to organisation (base field definition and update hook) and bumped version to 0.198
This commit is contained in:
@ -436,6 +436,26 @@ class OCOrganisation extends EditorialContentEntityBase implements OCOrganisatio
|
||||
->setRevisionable(TRUE)
|
||||
->setTranslatable(TRUE);
|
||||
|
||||
$fields['files'] = BaseFieldDefinition::create('file')
|
||||
->setLabel(t('Files'))
|
||||
->setDescription(t('Files relating to this organisation'))
|
||||
->setSetting('file_directory', '[date:custom:Y]-[date:custom:m]')
|
||||
->setSetting('handler', 'default:file')
|
||||
->setSetting('file_extensions', 'txt jpg jpeg gif rtf xls xlsx doc swf png pdf docx csv')
|
||||
->setSetting('description_field', 'true')
|
||||
->setSetting('uri_scheme', 'private')
|
||||
->setCardinality(-1)
|
||||
->setDisplayOptions('form', [
|
||||
'type' => 'file_generic',
|
||||
'weight' => 61,
|
||||
'settings' => [
|
||||
'progress_indicator' => 'throbber',
|
||||
],
|
||||
])
|
||||
->setDisplayOptions('view', [
|
||||
'label' => 'above',
|
||||
'settings' => ['use_description_as_link_text' => 'true']
|
||||
]);
|
||||
return $fields;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user