Added description field to case fee
This commit is contained in:
parent
5b10fb7328
commit
bc442f9842
@ -1,6 +1,23 @@
|
||||
<?php
|
||||
use \Drupal\Core\Field\BaseFieldDefinition;
|
||||
|
||||
function opencase_cases_update_90004() {
|
||||
$field_storage_definition = BaseFieldDefinition::create('string_long')
|
||||
->setRevisionable(TRUE)
|
||||
->setLabel(t('Description'))
|
||||
->setSettings(array(
|
||||
'default_value' => '',
|
||||
'max_length' => 255,
|
||||
'text_processing' => 0,
|
||||
))
|
||||
->setDisplayConfigurable('form', true)
|
||||
->setDisplayConfigurable('view', true);
|
||||
|
||||
|
||||
\Drupal::entityDefinitionUpdateManager()
|
||||
->installFieldStorageDefinition('description', 'oc_case_fee', 'opencase_cases', $field_storage_definition);
|
||||
}
|
||||
|
||||
function opencase_cases_update_90002() {
|
||||
$field_storage_definition = BaseFieldDefinition::create('entity_reference')
|
||||
->setLabel(t('Target'))
|
||||
|
@ -226,7 +226,9 @@ class OCCaseFee extends EditorialContentEntityBase implements OCCaseFeeInterface
|
||||
->setDisplayConfigurable('view', TRUE)
|
||||
->setRequired(TRUE);
|
||||
|
||||
$fields['status']->setDescription(t('A boolean indicating whether the Case Fee is published.'))
|
||||
$fields['status'] = BaseFieldDefinition::create('boolean')
|
||||
->setLabel(t('Visible'))
|
||||
->setDescription(t('A boolean indicating whether the Case Fee is published.'))
|
||||
->setDisplayConfigurable('form', TRUE)
|
||||
->setDisplayConfigurable('view', TRUE);
|
||||
|
||||
@ -266,6 +268,17 @@ class OCCaseFee extends EditorialContentEntityBase implements OCCaseFeeInterface
|
||||
->setDisplayConfigurable("view", true)
|
||||
->setDisplayConfigurable("form", true)
|
||||
->setRequired(FALSE);
|
||||
|
||||
$fields['description'] = BaseFieldDefinition::create('string_long')
|
||||
->setRevisionable(TRUE)
|
||||
->setLabel(t('Description'))
|
||||
->setSettings(array(
|
||||
'default_value' => '',
|
||||
'max_length' => 255,
|
||||
'text_processing' => 0,
|
||||
))
|
||||
->setDisplayConfigurable('form', true)
|
||||
->setDisplayConfigurable('view', true);
|
||||
|
||||
$fields['amount'] = BaseFieldDefinition::create('decimal')
|
||||
->setLabel(t('Amount'))
|
||||
|
Reference in New Issue
Block a user