1 | <?php |
||
23 | class PageUrlProvider implements UrlProviderInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var PageRepositoryInterface|EntityRepository |
||
27 | */ |
||
28 | private $pageRepository; |
||
29 | |||
30 | /** |
||
31 | * @var RouterInterface |
||
32 | */ |
||
33 | private $router; |
||
34 | |||
35 | /** |
||
36 | * @var SitemapUrlFactoryInterface |
||
37 | */ |
||
38 | private $sitemapUrlFactory; |
||
39 | |||
40 | /** |
||
41 | * @var LocaleContextInterface |
||
42 | */ |
||
43 | private $localeContext; |
||
44 | |||
45 | /** |
||
46 | * @var ChannelContextInterface |
||
47 | */ |
||
48 | private $channelContext; |
||
49 | |||
50 | /** |
||
51 | * @var array |
||
52 | */ |
||
53 | private $urls = []; |
||
54 | |||
55 | /** |
||
56 | * @var array |
||
57 | */ |
||
58 | private $channelLocaleCodes; |
||
59 | |||
60 | /** |
||
61 | * @param PageRepositoryInterface $pageRepository |
||
62 | * @param RouterInterface $router |
||
63 | * @param SitemapUrlFactoryInterface $sitemapUrlFactory |
||
64 | * @param LocaleContextInterface $localeContext |
||
65 | * @param ChannelContextInterface $channelContext |
||
66 | */ |
||
67 | public function __construct( |
||
80 | |||
81 | /** |
||
82 | * @return string |
||
83 | */ |
||
84 | public function getName(): string |
||
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | public function generate(): iterable |
||
100 | |||
101 | /** |
||
102 | * @param PageInterface $page |
||
103 | * |
||
104 | * @return Collection|PageTranslationInterface[] |
||
105 | */ |
||
106 | private function getTranslations(PageInterface $page): Collection |
||
112 | |||
113 | /** |
||
114 | * @param TranslationInterface $translation |
||
115 | * |
||
116 | * @return bool |
||
117 | */ |
||
118 | private function localeInLocaleCodes(TranslationInterface $translation): bool |
||
122 | |||
123 | /** |
||
124 | * @return array|PageInterface[] |
||
125 | */ |
||
126 | private function getPages(): iterable |
||
130 | |||
131 | /** |
||
132 | * @return array |
||
133 | */ |
||
134 | private function getLocaleCodes(): array |
||
146 | |||
147 | /** |
||
148 | * @param PageInterface $page |
||
149 | * |
||
150 | * @return SitemapUrlInterface |
||
151 | */ |
||
152 | private function createPageUrl(PageInterface $page): SitemapUrlInterface |
||
184 | } |
||
185 |