From b76547767ae897b6de752c56e2cef6079ca4abcb Mon Sep 17 00:00:00 2001 From: polo Date: Thu, 11 Jun 2026 01:35:57 +0200 Subject: =?UTF-8?q?classe=20EmailForm=20=C3=A0=20Email=20et=20d=C3=A9tacha?= =?UTF-8?q?ble=20de=20Node?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/entities/EmailForm.php | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/model/entities/EmailForm.php (limited to 'src/model/entities/EmailForm.php') diff --git a/src/model/entities/EmailForm.php b/src/model/entities/EmailForm.php new file mode 100644 index 0000000..466a389 --- /dev/null +++ b/src/model/entities/EmailForm.php @@ -0,0 +1,58 @@ +data = $data; + $this->node = $node; + } + + public function getId(): int + { + return $this->id_email_form; + } + + // getData et updateData sont indentiques au code dans NodeData + // plutôt qu'une interface, pourquoi pas une classe abstraite? ou peut-être un trait? + public function getData(): array + { + return $this->data; + } + public function updateData(string $key, string|int|bool|array $value = ''): void + { + 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 + { + $this->node = $node; + } +} \ No newline at end of file -- cgit v1.2.3