1 | <?php namespace Arcanedev\LaravelSitemap; |
||
12 | class SitemapBuilder |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Main Methods |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | |||
19 | /** |
||
20 | * Create the builder instance. |
||
21 | * |
||
22 | * @return self |
||
23 | */ |
||
24 | 20 | public static function make() |
|
28 | |||
29 | /** |
||
30 | * Build the sitemap. |
||
31 | * |
||
32 | * @param string $name |
||
33 | * @param \Illuminate\Support\Collection $sitemaps |
||
34 | * @param string $format |
||
35 | * |
||
36 | * @return string|null |
||
37 | */ |
||
38 | 20 | public function build($name, $sitemaps, $format) |
|
56 | |||
57 | /* ----------------------------------------------------------------- |
||
58 | | Other Methods |
||
59 | | ----------------------------------------------------------------- |
||
60 | */ |
||
61 | |||
62 | /** |
||
63 | * Build a single sitemap item. |
||
64 | * |
||
65 | * @param string $format |
||
66 | * @param \Arcanedev\LaravelSitemap\Contracts\Entities\Sitemap|null $sitemap |
||
67 | * @param string|null $key |
||
68 | * |
||
69 | * @return string|null |
||
70 | */ |
||
71 | 16 | protected function renderSitemap($format, $sitemap, $key = null) |
|
85 | |||
86 | /** |
||
87 | * Render sitemap index. |
||
88 | * |
||
89 | * @param string $format |
||
90 | * @param \Illuminate\Support\Collection $sitemaps |
||
91 | * |
||
92 | * @return null|string |
||
93 | */ |
||
94 | 14 | protected function renderSitemapIndex($format, $sitemaps) |
|
98 | |||
99 | /** |
||
100 | * Render the file. |
||
101 | * |
||
102 | * @param string $format |
||
103 | * @param string $type |
||
104 | * @param array $data |
||
105 | * |
||
106 | * @return null|string |
||
107 | */ |
||
108 | 18 | protected function render($format, $type, array $data) |
|
122 | |||
123 | /** |
||
124 | * Render the xml file. |
||
125 | * |
||
126 | * @param string $format |
||
127 | * @param string $type |
||
128 | * @param array $data |
||
129 | * |
||
130 | * @return string |
||
131 | */ |
||
132 | protected function renderXml($format, $type, array $data) |
||
142 | |||
143 | /** |
||
144 | * Render with illuminate. |
||
145 | * |
||
146 | * @param string $type |
||
147 | * @param string $format |
||
148 | * @param array $data |
||
149 | * |
||
150 | * @return string |
||
151 | */ |
||
152 | 16 | protected function renderView($type, $format, array $data) |
|
156 | } |
||
157 |