diff --git a/modules/opencase_entities/src/Entity/OCActivity.php b/modules/opencase_entities/src/Entity/OCActivity.php index 4c00b19..b126ca7 100644 --- a/modules/opencase_entities/src/Entity/OCActivity.php +++ b/modules/opencase_entities/src/Entity/OCActivity.php @@ -250,6 +250,25 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte ->setDisplayConfigurable('view', TRUE) ->setRequired(TRUE); + $fields['oc_case'] = BaseFieldDefinition::create('entity_reference') + ->setLabel(t('Case')) + ->setDescription(t('The case this activity belongs to.')) + ->setSetting('target_type', 'oc_case') + ->setSetting('handler', 'default') + ->setTranslatable(TRUE) + ->setCardinality(1) + ->setDisplayOptions('form', [ + 'type' => 'entity_reference_autocomplete', + 'weight' => 5, + 'settings' => [ + 'match_operator' => 'CONTAINS', + 'size' => '60', + 'autocomplete_type' => 'tags', + 'placeholder' => '', + ], + ]) + ->setRequired(TRUE); + $fields['status'] = BaseFieldDefinition::create('boolean') ->setLabel(t('Publishing status')) ->setDescription(t('A boolean indicating whether the Activity is published.')) diff --git a/modules/opencase_entities/src/Entity/OCCase.php b/modules/opencase_entities/src/Entity/OCCase.php index 3cab1c5..688dd23 100644 --- a/modules/opencase_entities/src/Entity/OCCase.php +++ b/modules/opencase_entities/src/Entity/OCCase.php @@ -250,6 +250,25 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface { ->setDisplayConfigurable('view', TRUE) ->setRequired(TRUE); + $fields['actors_involved'] = BaseFieldDefinition::create('entity_reference') + ->setLabel(t('Involved Parties')) + ->setDescription(t('People involved in this case, in their various capacities')) + ->setSetting('target_type', 'oc_actor') + ->setSetting('handler', 'default') + ->setTranslatable(TRUE) + ->setCardinality(-1) + ->setDisplayOptions('form', [ + 'type' => 'entity_reference_autocomplete', + 'weight' => 5, + 'settings' => [ + 'match_operator' => 'CONTAINS', + 'size' => '60', + 'autocomplete_type' => 'tags', + 'placeholder' => '', + ], + ]) + ->setRequired(TRUE); + $fields['status'] = BaseFieldDefinition::create('boolean') ->setLabel(t('Publishing status')) ->setDescription(t('A boolean indicating whether the Case is published.'))