diff options
Diffstat (limited to 'src/model/entities/Node.php')
-rw-r--r-- | src/model/entities/Node.php | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/model/entities/Node.php b/src/model/entities/Node.php index 76ef74b..2034b3d 100644 --- a/src/model/entities/Node.php +++ b/src/model/entities/Node.php | |||
@@ -176,25 +176,6 @@ class Node | |||
176 | $this->sortChildren(false); | 176 | $this->sortChildren(false); |
177 | } | 177 | } |
178 | } | 178 | } |
179 | |||
180 | // remplacée par "ORDER BY a.date_time" en DQL | ||
181 | /*private function sortNews(bool $chrono = false) // affichage du plus récent au plus ancien par défaut | ||
182 | { | ||
183 | // tri par insertion similaire à Position::sortChildren | ||
184 | for($i = 1; $i < count($this->children); $i++){ | ||
185 | $tmp = $this->children[$i]; | ||
186 | $j = $i - 1; | ||
187 | |||
188 | $compare = $chrono ? fn($a, $b) => $a > $b : fn($a, $b) => $a < $b; | ||
189 | |||
190 | while($j >= 0 && $compare($this->children[$j]->getArticle()->getDateTime(), $tmp->getArticle()->getDateTime())){ | ||
191 | $this->children[$j + 1] = $this->children[$j]; | ||
192 | $j--; | ||
193 | } | ||
194 | $this->children[$j + 1] = $tmp; | ||
195 | } | ||
196 | }*/ | ||
197 | |||
198 | public function removeChild(self $child): void | 179 | public function removeChild(self $child): void |
199 | { | 180 | { |
200 | foreach($this->children as $key => $object){ | 181 | foreach($this->children as $key => $object){ |