@@ 479-490 (lines=12) @@ | ||
476 | * |
|
477 | * @return string |
|
478 | */ |
|
479 | public function getTree(string $separator = '/') |
|
480 | { |
|
481 | $tree = ''; |
|
482 | ||
483 | $current = $this; |
|
484 | do { |
|
485 | $tree = $current->getSlug().$separator.$tree; |
|
486 | $current = $current->getParent(); |
|
487 | } while ($current); |
|
488 | ||
489 | return trim($tree, $separator); |
|
490 | } |
|
491 | ||
492 | /** |
|
493 | * @ORM\PrePersist() |
@@ 251-262 (lines=12) @@ | ||
248 | * |
|
249 | * @return string |
|
250 | */ |
|
251 | public function getTree(string $separator = '/'): string |
|
252 | { |
|
253 | $tree = ''; |
|
254 | ||
255 | $current = $this; |
|
256 | do { |
|
257 | $tree = $current->getSlug().$separator.$tree; |
|
258 | $current = $current->getParent(); |
|
259 | } while ($current); |
|
260 | ||
261 | return trim($tree, $separator); |
|
262 | } |
|
263 | ||
264 | /** |
|
265 | * @ORM\PrePersist() |