diff options
Diffstat (limited to 'src/controller/Director.php')
| -rw-r--r-- | src/controller/Director.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/controller/Director.php b/src/controller/Director.php index 4b9293c..8f038fa 100644 --- a/src/controller/Director.php +++ b/src/controller/Director.php | |||
| @@ -18,17 +18,19 @@ class Director | |||
| 18 | private ?Node $node; | 18 | private ?Node $node; |
| 19 | private Node $article; | 19 | private Node $article; |
| 20 | 20 | ||
| 21 | public function __construct(EntityManager $entityManager, bool $get_menu = false) | 21 | public function __construct(EntityManager $entityManager) |
| 22 | { | 22 | { |
| 23 | $this->entityManager = $entityManager; | 23 | $this->entityManager = $entityManager; |
| 24 | if($get_menu){ | ||
| 25 | self::$menu_data = new Menu($entityManager); | ||
| 26 | self::$page_path = new Path(); | ||
| 27 | $this->page = self::$page_path->getLast(); | ||
| 28 | } | ||
| 29 | $this->node = new Node; // instance mère "vide" ne possédant rien d'autre que des enfants | 24 | $this->node = new Node; // instance mère "vide" ne possédant rien d'autre que des enfants |
| 30 | } | 25 | } |
| 31 | 26 | ||
| 27 | public function makeMenuAndPaths(): void | ||
| 28 | { | ||
| 29 | self::$menu_data = new Menu($this->entityManager); | ||
| 30 | self::$page_path = new Path(); | ||
| 31 | $this->page = self::$page_path->getLast(); | ||
| 32 | } | ||
| 33 | |||
| 32 | public function getNode(): Node | 34 | public function getNode(): Node |
| 33 | { | 35 | { |
| 34 | return $this->node; | 36 | return $this->node; |
