diff options
Diffstat (limited to 'src/model/entities/NodeData.php')
-rw-r--r-- | src/model/entities/NodeData.php | 10 |
1 files changed, 8 insertions, 2 deletions
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 | |||
55 | { | 55 | { |
56 | $this->data = $data; | 56 | $this->data = $data; |
57 | }*/ | 57 | }*/ |
58 | public function updateData(string $key, string $value): void | 58 | public function updateData(string $key, string $value = ''): void |
59 | { | 59 | { |
60 | $this->data[$key] = $value; | 60 | if($value !== ''){ |
61 | $this->data[$key] = $value; | ||
62 | } | ||
63 | // si $value est vide, supprime la clé | ||
64 | elseif(isset($this->data[$key])){ | ||
65 | unset($this->data[$key]); | ||
66 | } | ||
61 | } | 67 | } |
62 | /*public function setNode(Node $node): void | 68 | /*public function setNode(Node $node): void |
63 | { | 69 | { |