From 012588de7b13f55dfd023f66818ecd732712f7fa Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 4 Jun 2021 09:46:40 +0200 Subject: [PATCH] refactoring url generator --- src/UrlGenerator/PostGenerator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/UrlGenerator/PostGenerator.php b/src/UrlGenerator/PostGenerator.php index 37a0470..cfeefc4 100644 --- a/src/UrlGenerator/PostGenerator.php +++ b/src/UrlGenerator/PostGenerator.php @@ -2,6 +2,7 @@ namespace App\UrlGenerator; +use App\Core\Entity\Site\Node; use App\Entity\Blog\Category; use App\Repository\Blog\CategoryRepositoryQuery; use App\Repository\Blog\PostRepositoryQuery; @@ -28,7 +29,7 @@ class PostGenerator $this->urlGenerator = $urlGenerator; } - public function post(): array + public function post(Node $node, array $options): array { $entities = $this->postQuery->create() ->published() @@ -39,7 +40,7 @@ class PostGenerator foreach ($entities as $entity) { $urls[] = $this->urlGenerator->generate( - 'blog_menu_post', + $node->getRouteName(), [ 'post' => $entity->getId(), 'slug' => $entity->getSlug(),