From 03e6c2432bd120fe57f5569764e2f9e2871f19c4 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Tue, 10 Mar 2026 18:00:09 +0100 Subject: [PATCH] fix(machine) : add addConstructeur/removeConstructeur methods + fix fournisseur display API Platform silently ignored the constructeurs field on PATCH because Machine was missing the add/remove methods (unlike Composant, Piece, Product). Also fixes the read-only fournisseur display overflow in MachineInfoCard. Co-Authored-By: Claude Opus 4.6 --- Inventory_frontend | 2 +- src/Entity/Machine.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Inventory_frontend b/Inventory_frontend index b0124c1..5c31045 160000 --- a/Inventory_frontend +++ b/Inventory_frontend @@ -1 +1 @@ -Subproject commit b0124c11ba3b9fb51db323213992ccb3164f5b70 +Subproject commit 5c31045e834d6d48c69c18bf4066cc3c343e14b4 diff --git a/src/Entity/Machine.php b/src/Entity/Machine.php index fe0901d..ebb0dc8 100644 --- a/src/Entity/Machine.php +++ b/src/Entity/Machine.php @@ -210,6 +210,22 @@ class Machine return $this->constructeurs; } + public function addConstructeur(Constructeur $constructeur): static + { + if (!$this->constructeurs->contains($constructeur)) { + $this->constructeurs->add($constructeur); + } + + return $this; + } + + public function removeConstructeur(Constructeur $constructeur): static + { + $this->constructeurs->removeElement($constructeur); + + return $this; + } + /** * @return Collection */