aboutsummaryrefslogtreecommitdiff
path: root/src/controller/Director.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/controller/Director.php')
-rw-r--r--src/controller/Director.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/controller/Director.php b/src/controller/Director.php
index b154432..6ee0993 100644
--- a/src/controller/Director.php
+++ b/src/controller/Director.php
@@ -13,7 +13,7 @@ class Director
13 static public Menu $menu_data; // pour NavBuilder 13 static public Menu $menu_data; // pour NavBuilder
14 static public ?Path $page_path = null; // pour $current dans NavBuilder et pour BreadcrumbBuilder 14 static public ?Path $page_path = null; // pour $current dans NavBuilder et pour BreadcrumbBuilder
15 private Page $page; 15 private Page $page;
16 private Node $node; 16 private ?Node $node;
17 private Node $article; 17 private Node $article;
18 18
19 public function __construct(EntityManager $entityManager, bool $get_menu = false) 19 public function __construct(EntityManager $entityManager, bool $get_menu = false)
@@ -82,8 +82,10 @@ class Director
82 $node->getParent()->addChild($node); 82 $node->getParent()->addChild($node);
83 83
84 // spécifique page article 84 // spécifique page article
85 if($node->getName() === 'new' && $this->page->getEndOfPath() == 'article'){ 85 if($this->page->getEndOfPath() == 'article'){
86 $new = $node; 86 if($node->getName() === 'new'){
87 $new = $node;
88 }
87 } 89 }
88 } 90 }
89 } 91 }
@@ -93,9 +95,10 @@ class Director
93 } 95 }
94 96
95 // le basique 97 // le basique
96 public function findNodeById(int $id): void 98 public function findNodeById(int $id): bool
97 { 99 {
98 $this->node = $this->entityManager->find('App\Entity\Node', $id); 100 $this->node = $this->entityManager->find('App\Entity\Node', $id);
101 return $this->node === null ? false : true;
99 } 102 }
100 103
101 // récupération d'un article pour modification 104 // récupération d'un article pour modification