From 3104104e838b7d57de49daba0178b1aefe646548 Mon Sep 17 00:00:00 2001 From: polo Date: Fri, 4 Jul 2025 10:29:45 +0200 Subject: formulaire de contact 4 --- src/model/entities/NodeData.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/model/entities/NodeData.php') diff --git a/src/model/entities/NodeData.php b/src/model/entities/NodeData.php index 9d23b8b..758ccb7 100644 --- a/src/model/entities/NodeData.php +++ b/src/model/entities/NodeData.php @@ -55,9 +55,15 @@ class NodeData { $this->data = $data; }*/ - public function updateData(string $key, string $value): void + public function updateData(string $key, string $value = ''): void { - $this->data[$key] = $value; + if($value !== ''){ + $this->data[$key] = $value; + } + // si $value est vide, supprime la clé + elseif(isset($this->data[$key])){ + unset($this->data[$key]); + } } /*public function setNode(Node $node): void { -- cgit v1.2.3