From 42ae835581f31999a91e62fa5d14975b5193b704 Mon Sep 17 00:00:00 2001 From: Jonathan Foucher <jfoucher@gmail.com> Date: Tue, 18 Feb 2025 10:39:45 +0100 Subject: [PATCH] Can add proofs to measurment ont measurment side. Fixes https://gitlab.adullact.net/soluris/madis/-/issues/994 --- src/Domain/Registry/Model/Mesurement.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Domain/Registry/Model/Mesurement.php b/src/Domain/Registry/Model/Mesurement.php index cabadb415..baf53ede7 100644 --- a/src/Domain/Registry/Model/Mesurement.php +++ b/src/Domain/Registry/Model/Mesurement.php @@ -441,6 +441,20 @@ class Mesurement implements LoggableSubject, CollectivityRelated $this->proofs = $proofs; } + public function addProof(Proof $proof): void + { + $this->proofs->add($proof); + $proof->addMesurement($this); + } + + public function removeProof(Proof $proof): void + { + if ($this->proofs->count() && $this->proofs->contains($proof)) { + $this->proofs->removeElement($proof); + } + $proof->removeMesurement($this); + } + public function getAnswerSurveys(): ?iterable { return $this->answerSurveys; -- GitLab