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/entities/Node.php | 166 -------------------------------------------- 1 file changed, 166 deletions(-) delete mode 100644 src/model/entities/Node.php (limited to 'src/model/entities/Node.php') diff --git a/src/model/entities/Node.php b/src/model/entities/Node.php deleted file mode 100644 index 7932efc..0000000 --- a/src/model/entities/Node.php +++ /dev/null @@ -1,166 +0,0 @@ -name_node = $name; - $this->position = $position; - $this->parent = $parent; - $this->page = $page; - $this->article = $article; - } - - // pfff... - public function getId(): ?int - { - return $this->id_node; - } - public function getName(): string - { - return $this->name_node; - } - /*public function setName(string $name): void - { - $this->name_node = $name; - }*/ - - public function getParent(): ?self - { - return $this->parent; - } - /*public function setParent(?self $parent): void - { - $this->parent = $parent; - }*/ - public function getPosition(): int - { - return $this->position; - } - public function setPosition(int $position): void - { - $this->position = $position; - } - public function getPage(): Page - { - return $this->page; - } - /*public function setPage(Page $page): void - { - $this->page = $page; - }*/ - - // utiliser l'interface de NodeData et EmailForm - public function getArticle(): Article - { - return $this->article; - } - /*public function setArticle(Article $article): void - { - $this->article = $article; - }*/ - - // une interface serait cool! - // OU possible un "héritage doctrine", faire en sorte que Node soit la mère de NodeData, EmailForm, Article... - // une seule instance est matérialisée par plusieurs tables en même temps - public function getNodeData(): NodeData|EmailForm|Presentation|null - { - // pour du polymorphisme (une unique variable $node_data): opter pour l'héritage - return match($this->name_node){ - 'form' => $this->email_form, - 'post_block', 'news_block' => $this->presentation, - default => $this->node_data, // inclut 'calendar' - }; - } - public function getChildren(): array - { - return $this->children; - } - public function getNodeByName(string $name): ?Node - { - foreach($this->children as $child){ - if($child->getName() === $name){ - return $child; - } - } - return null; - } - public function addChild(self $child): void - { - $this->children[] = $child; - - if(!Presentation::hasPresentation($this->getName())){ // post_block et news_block ont leurs enfants ordonnés avec ORDER BY - $this->sortChildren(false); - } - } - public function removeChild(self $child): void - { - foreach($this->children as $key => $object){ - if($object->getId() === $child->getId()){ - unset($this->children[$key]); - } - break; - } - $this->children = array_values($this->children); // réindexer pour supprimer la case vide - } - - public function getAdoptedChild(): ?self // peut renvoyer null - { - return $this->adopted; - } - public function setAdoptedChild(self $child): void - { - $this->adopted = $child; - } -} -- cgit v1.2.3