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; } }