Added notes field to cases

This commit is contained in:
naomi 2021-11-11 15:27:25 +00:00
parent 8cde0b8892
commit de691b5a52
2 changed files with 25 additions and 0 deletions

View File

@ -57,3 +57,18 @@ function opencase_cases_update_8028() {
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('oc_fee_category', 'oc_case_fee', 'oc_case_fee', $storage_definition);
}
function opencase_cases_update_8029() {
$storage_definition = \Drupal\Core\Field\BaseFieldDefinition::create('string_long')
->setRevisionable(TRUE)
->setLabel(t('Notes'))
->setSettings(array(
'default_value' => '',
'max_length' => 255,
'text_processing' => 0,
))
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('notes', 'oc_case', 'oc_case', $storage_definition);
}

View File

@ -295,6 +295,16 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface {
->setRevisionable(TRUE)
->setTranslatable(TRUE);
$fields['notes'] = BaseFieldDefinition::create('string_long')
->setRevisionable(TRUE)
->setLabel(t('Notes'))
->setSettings(array(
'default_value' => '',
'max_length' => 255,
'text_processing' => 0,
))
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true);
return $fields;
}
}