diff options
| author | polo <ordipolo@gmx.fr> | 2025-04-07 07:46:27 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-04-07 07:46:27 +0200 |
| commit | 09bea09c8157ff45279f0d06aa9d313448c0bec5 (patch) | |
| tree | 4f79c47678df12cb508607be040050c8f08455aa /src/model | |
| parent | 022d0c36258c874a21a36e207ae89aa8d91e44a1 (diff) | |
| download | cms-09bea09c8157ff45279f0d06aa9d313448c0bec5.tar.gz cms-09bea09c8157ff45279f0d06aa9d313448c0bec5.tar.bz2 cms-09bea09c8157ff45279f0d06aa9d313448c0bec5.zip | |
nouvelle "news"
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/Path.php | 6 | ||||
| -rw-r--r-- | src/model/entities/Node.php | 10 |
2 files changed, 5 insertions, 11 deletions
diff --git a/src/model/Path.php b/src/model/Path.php index 6faadfd..11be6fe 100644 --- a/src/model/Path.php +++ b/src/model/Path.php | |||
| @@ -17,12 +17,6 @@ class Path extends Page | |||
| 17 | $this->findPage(Director::$menu_data, $path_array); // remplit $this->current_page | 17 | $this->findPage(Director::$menu_data, $path_array); // remplit $this->current_page |
| 18 | } | 18 | } |
| 19 | catch(Exception $e){} | 19 | catch(Exception $e){} |
| 20 | /*echo "nb d'autres pages: " . count(Director::$menu_data->getOtherPages()) . '<br>'; | ||
| 21 | echo 'longueur du chemin: ' . count($this->current_page) . '<br>'; | ||
| 22 | foreach($this->current_page as $current){ | ||
| 23 | echo $current->getEndOfPath() . ' '; | ||
| 24 | } | ||
| 25 | die;*/ | ||
| 26 | } | 20 | } |
| 27 | 21 | ||
| 28 | // produit un tableau de Page en comparant le chemin demandé avec les données dans Menu | 22 | // produit un tableau de Page en comparant le chemin demandé avec les données dans Menu |
diff --git a/src/model/entities/Node.php b/src/model/entities/Node.php index c9b310a..a52a7e6 100644 --- a/src/model/entities/Node.php +++ b/src/model/entities/Node.php | |||
| @@ -52,7 +52,7 @@ class Node | |||
| 52 | // -- fin des attributs destinés à doctrine, début du code utilisateur -- | 52 | // -- fin des attributs destinés à doctrine, début du code utilisateur -- |
| 53 | 53 | ||
| 54 | private array $children = []; // tableau de Node | 54 | private array $children = []; // tableau de Node |
| 55 | private ?self $temp_child = null; // = "new" est l'enfant de "main" lorsque la page est "article" | 55 | private ?self $adopted = null; // = "new" est un enfant de "main" lorsque la page est "article" |
| 56 | 56 | ||
| 57 | public function __construct(string $name = '', ?string $article_timestamp = null, array $attributes = [], int $position = 0, ?self $parent = null, ?Page $page = null, ?Article $article = null) | 57 | public function __construct(string $name = '', ?string $article_timestamp = null, array $attributes = [], int $position = 0, ?self $parent = null, ?Page $page = null, ?Article $article = null) |
| 58 | { | 58 | { |
| @@ -176,12 +176,12 @@ class Node | |||
| 176 | $this->children = array_values($this->children); // réindexer pour supprimer la case vide | 176 | $this->children = array_values($this->children); // réindexer pour supprimer la case vide |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | public function getTempChild(): ?self // peut renvoyer null | 179 | public function getAdoptedChild(): ?self // peut renvoyer null |
| 180 | { | 180 | { |
| 181 | return $this->temp_child; | 181 | return $this->adopted; |
| 182 | } | 182 | } |
| 183 | public function setTempChild(self $child): void | 183 | public function setAdoptedChild(self $child): void |
| 184 | { | 184 | { |
| 185 | $this->temp_child = $child; | 185 | $this->adopted = $child; |
| 186 | } | 186 | } |
| 187 | } | 187 | } |
