From a3ba7dde60dc1c94b7170ec28266a966e5004d33 Mon Sep 17 00:00:00 2001 From: polo Date: Tue, 22 Apr 2025 00:39:54 +0200 Subject: page menu et chemin, partie 2 --- src/model/Menu.php | 6 ------ src/model/entities/Page.php | 14 +++++++++++++- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'src/model') diff --git a/src/model/Menu.php b/src/model/Menu.php index 403accf..10cf3d5 100644 --- a/src/model/Menu.php +++ b/src/model/Menu.php @@ -38,12 +38,6 @@ class Menu extends Page foreach($this->getChildren() as $page){ $page->fillChildrenPagePath(); } - - /*for($i = 0; $i < count($this->getChildren()[1]->getChildren()); $i++){ - echo $this->getChildren()[1]->getChildren()[$i]->getEndOfPath() . ' - '; - echo $this->getChildren()[1]->getChildren()[$i]->getPageName() . '
'; - }*/ - //die; } public function getOtherPages(): array diff --git a/src/model/entities/Page.php b/src/model/entities/Page.php index c30305c..e3e60ca 100644 --- a/src/model/entities/Page.php +++ b/src/model/entities/Page.php @@ -34,6 +34,9 @@ class Page #[ORM\Column(type: "boolean")] private bool $in_menu; + #[ORM\Column(type: "boolean")] + private bool $hidden; + #[ORM\Column(type: "integer", nullable: true)] // null si hors menu private ?int $position; @@ -47,12 +50,13 @@ class Page /*#[ORM\Column(type: "json", nullable: true)] private ?array $metadata = null;*/ - public function __construct(string $name, string $eop, bool $reachable, bool $in_menu, ?int $position, ?Page $parent) + public function __construct(string $name, string $eop, bool $reachable, bool $in_menu, bool $hidden, ?int $position, ?Page $parent) { $this->name_page = $name; $this->end_of_path = $eop; $this->reachable = $reachable; $this->in_menu = $in_menu; + $this->hidden = $hidden; $this->position = $position; $this->parent = $parent; $this->children = new ArrayCollection(); @@ -83,6 +87,14 @@ class Page { return $this->in_menu; } + public function isHidden(): bool + { + return $this->hidden; + } + public function setHidden(bool $hidden): void + { + $this->hidden = $hidden; + } public function getPosition(): ?int { return $this->position; -- cgit v1.2.3