Added fields to bank account entity

This commit is contained in:
naomi 2021-02-07 12:02:47 +00:00
parent eee7604440
commit 4285e1952f
1 changed files with 45 additions and 5 deletions

View File

@ -165,7 +165,6 @@ class OCBankAccount extends ContentEntityBase implements OCBankAccountInterface
$fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Name'))
->setDescription(t('The name of the Bank Account entity.'))
->setSettings([
'max_length' => 50,
'text_processing' => 0,
@ -184,11 +183,52 @@ class OCBankAccount extends ContentEntityBase implements OCBankAccountInterface
->setDisplayConfigurable('view', TRUE)
->setRequired(TRUE);
$fields['status']->setDescription(t('A boolean indicating whether the Bank Account is published.'))
->setDisplayOptions('form', [
'type' => 'boolean_checkbox',
$fields['account_number'] = BaseFieldDefinition::create('string')
->setLabel(t('Account Number'))
->setSettings([
'max_length' => 50,
'text_processing' => 0,
])
->setDefaultValue('')
->setDisplayOptions('view', [
'label' => 'above',
'type' => 'string',
'weight' => -3,
]);
])
->setDisplayOptions('form', [
'type' => 'string_textfield',
'weight' => -3,
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE)
->setRequired(TRUE);
$fields['sort_code'] = BaseFieldDefinition::create('string')
->setLabel(t('Sort Code'))
->setSettings([
'max_length' => 50,
'text_processing' => 0,
])
->setDefaultValue('')
->setDisplayOptions('view', [
'label' => 'above',
'type' => 'string',
'weight' => -2,
])
->setDisplayOptions('form', [
'type' => 'string_textfield',
'weight' => -2,
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE)
->setRequired(TRUE);
$fields['status']->setDescription(t('A boolean indicating whether the Bank Account is published.'))
//->setDisplayOptions('form', [
// 'type' => 'boolean_checkbox',
// 'weight' => -1,
//])
;
$fields['created'] = BaseFieldDefinition::create('created')
->setLabel(t('Created'))