Added subject field to activity, and made that the label

This commit is contained in:
naomi 2018-04-14 16:01:06 +02:00
parent 09142a52dc
commit 33a8b1e0a5

View File

@ -42,7 +42,7 @@ use Drupal\user\UserInterface;
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "bundle" = "type", * "bundle" = "type",
* "label" = "name", * "label" = "subject",
* "uuid" = "uuid", * "uuid" = "uuid",
* "uid" = "user_id", * "uid" = "user_id",
* "langcode" = "langcode", * "langcode" = "langcode",
@ -187,9 +187,9 @@ class Activity extends ContentEntityBase implements ActivityInterface {
->setDescription(t('The case this activity belongs to.')) ->setDescription(t('The case this activity belongs to.'))
->setSetting('target_type', 'case_entity'); ->setSetting('target_type', 'case_entity');
$fields['name'] = BaseFieldDefinition::create('string') $fields['subject'] = BaseFieldDefinition::create('string')
->setLabel(t('Name')) ->setLabel(t('Subject'))
->setDescription(t('The name of the Activity.')) ->setDescription(t('The purpose of the Activity.'))
->setSettings([ ->setSettings([
'max_length' => 50, 'max_length' => 50,
'text_processing' => 0, 'text_processing' => 0,
@ -204,8 +204,6 @@ class Activity extends ContentEntityBase implements ActivityInterface {
'type' => 'string_textfield', 'type' => 'string_textfield',
'weight' => -4, 'weight' => -4,
]) ])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE)
->setRequired(TRUE); ->setRequired(TRUE);
$fields['status'] = BaseFieldDefinition::create('boolean') $fields['status'] = BaseFieldDefinition::create('boolean')