From d7c484160df384cadcdb76db2b8d6806bf19e0ba Mon Sep 17 00:00:00 2001 From: Tom Udding Date: Thu, 24 Oct 2024 00:35:06 +0200 Subject: [PATCH] fix(decision): inconsistency in (sub)decision model with GEWISDB Somehow the possibility for these to be `null` got lost somewhere. --- module/Decision/src/Model/Decision.php | 9 ++++++++- module/Decision/src/Model/SubDecision/Installation.php | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/module/Decision/src/Model/Decision.php b/module/Decision/src/Model/Decision.php index 815b7b25e3..b52463f9be 100644 --- a/module/Decision/src/Model/Decision.php +++ b/module/Decision/src/Model/Decision.php @@ -6,6 +6,7 @@ use Decision\Model\Enums\MeetingTypes; use Decision\Model\SubDecision\Annulment; +use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; @@ -52,6 +53,7 @@ class Decision enumType: MeetingTypes::class, )] protected MeetingTypes $meeting_type; + /** * Meeting number. * @@ -103,7 +105,12 @@ enumType: MeetingTypes::class, targetEntity: Annulment::class, mappedBy: 'target', )] - protected Annulment $annulledBy; + protected ?Annulment $annulledBy = null; + + public function __construct() + { + $this->subdecisions = new ArrayCollection(); + } /** * Set the meeting. diff --git a/module/Decision/src/Model/SubDecision/Installation.php b/module/Decision/src/Model/SubDecision/Installation.php index 667cc904f7..61f68d8930 100644 --- a/module/Decision/src/Model/SubDecision/Installation.php +++ b/module/Decision/src/Model/SubDecision/Installation.php @@ -58,7 +58,7 @@ class Installation extends FoundationReference targetEntity: Discharge::class, mappedBy: 'installation', )] - protected Discharge $discharge; + protected ?Discharge $discharge = null; /** * The organmember reference. @@ -114,7 +114,7 @@ public function getReappointments(): Collection /** * Get the discharge, if it exists. */ - public function getDischarge(): Discharge + public function getDischarge(): ?Discharge { return $this->discharge; }