From 7eb0ee092bac1672f6c1fbe48e2c120ed4ee0f0b Mon Sep 17 00:00:00 2001 From: naomi Date: Sat, 14 Apr 2018 13:35:04 +0200 Subject: [PATCH] Added case field to activity --- modules/zencrm_entities/src/Entity/Activity.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/zencrm_entities/src/Entity/Activity.php b/modules/zencrm_entities/src/Entity/Activity.php index 5ea8719..14016a3 100644 --- a/modules/zencrm_entities/src/Entity/Activity.php +++ b/modules/zencrm_entities/src/Entity/Activity.php @@ -180,6 +180,13 @@ class Activity extends ContentEntityBase implements ActivityInterface { # ->setDisplayConfigurable('view', TRUE); ->setTranslatable(TRUE); + // This field is always implied from the context, + // so has no form or view display. + $fields['case'] = BaseFieldDefinition::create('entity_reference') + ->setLabel(t('Case')) + ->setDescription(t('The case this activity belongs to.')) + ->setSetting('target_type', 'case_entity'); + $fields['name'] = BaseFieldDefinition::create('string') ->setLabel(t('Name')) ->setDescription(t('The name of the Activity entity.'))