Added base field to Profile entity, which references the Person.
This commit is contained in:
parent
af3b194aa4
commit
60fefb703e
@ -1,5 +1,3 @@
|
||||
crm:~/drupal$
|
||||
070f7a04-6bdc-4992-bc48-20803c6ef0f4
|
||||
langcode: en
|
||||
status: true
|
||||
id: persons
|
||||
|
@ -224,9 +224,34 @@ class Profile extends RevisionableContentEntityBase implements ProfileInterface
|
||||
'autocomplete_type' => 'tags',
|
||||
'placeholder' => '',
|
||||
],
|
||||
]);
|
||||
|
||||
$fields['person'] = BaseFieldDefinition::create('entity_reference')
|
||||
->setLabel(t('Person'))
|
||||
->setDescription(t('The person this profile is of.'))
|
||||
->setSetting('target_type', 'person')
|
||||
->setSetting('handler', 'views')
|
||||
->setSetting('handler_settings', [
|
||||
'view' => [
|
||||
'view_name' => 'persons',
|
||||
'display_name' => 'entity_reference_1',
|
||||
'arguments' => []
|
||||
]
|
||||
])
|
||||
->setDisplayConfigurable('form', TRUE)
|
||||
->setDisplayConfigurable('view', TRUE);
|
||||
->setDisplayOptions('form', [
|
||||
'type' => 'entity_reference_autocomplete',
|
||||
'weight' => 5,
|
||||
'settings' => [
|
||||
'match_operator' => 'CONTAINS',
|
||||
'size' => '60',
|
||||
'autocomplete_type' => 'tags',
|
||||
'placeholder' => '',
|
||||
],
|
||||
])
|
||||
->setDisplayOptions('view', [
|
||||
'label' => 'above',
|
||||
'weight' => 0,
|
||||
]);
|
||||
|
||||
$fields['name'] = BaseFieldDefinition::create('string')
|
||||
->setLabel(t('Name'))
|
||||
|
Reference in New Issue
Block a user