Added full_name and first_and_last_name fields to the Person entity type.
The full name is now the entity label. The first_and_last_name is so that it can be used in search and autocomplete.
This commit is contained in:
@ -49,6 +49,7 @@ use Drupal\user\UserInterface;
|
||||
* "uid" = "user_id",
|
||||
* "langcode" = "langcode",
|
||||
* "status" = "status",
|
||||
* "label" = "full_name",
|
||||
* },
|
||||
* links = {
|
||||
* "canonical" = "/zencrm/person/{person}",
|
||||
@ -192,6 +193,16 @@ class Person extends RevisionableContentEntityBase implements PersonInterface {
|
||||
->setSetting('handler', 'default')
|
||||
->setTranslatable(TRUE);
|
||||
|
||||
$fields['full_name'] = BaseFieldDefinition::create('string')
|
||||
->setLabel(t('Full Name'))
|
||||
->setDescription(t('The full name of the person.'))
|
||||
->setRevisionable(TRUE);
|
||||
|
||||
$fields['first_and_last_name'] = BaseFieldDefinition::create('string')
|
||||
->setLabel(t('First and Last Name'))
|
||||
->setDescription(t('The first and last name of the person. Used for searching and autocomplete'))
|
||||
->setRevisionable(TRUE);
|
||||
|
||||
$fields['first_name'] = BaseFieldDefinition::create('string')
|
||||
->setLabel(t('First Name'))
|
||||
->setDescription(t('First Name.'))
|
||||
|
Reference in New Issue
Block a user