From f27cca08ff786ceff1870147f6d6bad14d71117f Mon Sep 17 00:00:00 2001 From: polo Date: Fri, 23 Oct 2026 00:47:32 +0200 Subject: =?UTF-8?q?dossiers=20avec=20majuscule,=20namespace=20pour=20toute?= =?UTF-8?q?s=20les=20classes,=20autoload=20psr-4,=20UserDataService::creat?= =?UTF-8?q?eZip=20d=C3=A9plac=C3=A9=20dans=20Backup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Model/Entity/NodeData.php | 102 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 src/Model/Entity/NodeData.php (limited to 'src/Model/Entity/NodeData.php') diff --git a/src/Model/Entity/NodeData.php b/src/Model/Entity/NodeData.php new file mode 100644 index 0000000..d81628d --- /dev/null +++ b/src/Model/Entity/NodeData.php @@ -0,0 +1,102 @@ + noeud "show_emails" + + public function __construct(array $data, Node $node, Collection $asset_employment = new ArrayCollection){ + $this->data = $data; + $this->node = $node; + $this->asset_employment = $asset_employment; + } + + public function getId(): int + { + return $this->id_node_data; + } + public function getData(): array + { + return $this->data; + } + /*public function setData(array $data): void // entrée = tableau associatif + { + $this->data = $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; + } + + public function getNodeDataAssets(): Collection + { + return $this->asset_employment; + } + public function getAssetEmploymentByRole(string $role): ?AssetEmployment + { + foreach($this->asset_employment as $nda){ + if($nda->getRole() === $role){ + return $nda; + } + } + return null; + } + public function getAssetByRole(string $role): ?Asset + { + $nda = $this->getAssetEmploymentByRole($role); + if($nda === null){ + return null; + } + return $nda->getAsset() ?? null; + } + + // pour affichage page Courriels + public function getEmails(): array // appelée dans ShowEmailsBuilder + { + return $this->emails; + } + public function setEmails(array $emails): void // appelée dans Model + { + $this->emails = $emails; + } +} \ No newline at end of file -- cgit v1.2.3