Skip to content

Commit e422c99

Browse files
committed
fix(decision): inconsistency in (sub)decision model with GEWISDB
Somehow the possibility for these to be `null` got lost somewhere.
1 parent 648e865 commit e422c99

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

module/Decision/src/Model/Decision.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Decision\Model\Enums\MeetingTypes;
88
use Decision\Model\SubDecision\Annulment;
9+
use Doctrine\Common\Collections\ArrayCollection;
910
use Doctrine\Common\Collections\Collection;
1011
use Doctrine\ORM\Mapping\Column;
1112
use Doctrine\ORM\Mapping\Entity;
@@ -52,6 +53,7 @@ class Decision
5253
enumType: MeetingTypes::class,
5354
)]
5455
protected MeetingTypes $meeting_type;
56+
5557
/**
5658
* Meeting number.
5759
*
@@ -103,7 +105,12 @@ enumType: MeetingTypes::class,
103105
targetEntity: Annulment::class,
104106
mappedBy: 'target',
105107
)]
106-
protected Annulment $annulledBy;
108+
protected ?Annulment $annulledBy = null;
109+
110+
public function __construct()
111+
{
112+
$this->subdecisions = new ArrayCollection();
113+
}
107114

108115
/**
109116
* Set the meeting.

module/Decision/src/Model/SubDecision/Installation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Installation extends FoundationReference
5858
targetEntity: Discharge::class,
5959
mappedBy: 'installation',
6060
)]
61-
protected Discharge $discharge;
61+
protected ?Discharge $discharge = null;
6262

6363
/**
6464
* The organmember reference.
@@ -114,7 +114,7 @@ public function getReappointments(): Collection
114114
/**
115115
* Get the discharge, if it exists.
116116
*/
117-
public function getDischarge(): Discharge
117+
public function getDischarge(): ?Discharge
118118
{
119119
return $this->discharge;
120120
}

0 commit comments

Comments
 (0)