1 | <?php namespace Arcanedev\LaravelSitemap; |
||
11 | class SitemapBuilder |
||
12 | { |
||
13 | /* ----------------------------------------------------------------- |
||
14 | | Main Methods |
||
15 | | ----------------------------------------------------------------- |
||
16 | */ |
||
17 | |||
18 | /** |
||
19 | * Create the builder instance. |
||
20 | * |
||
21 | * @return self |
||
22 | */ |
||
23 | 20 | public static function make() |
|
27 | |||
28 | /** |
||
29 | * Build the sitemap. |
||
30 | * |
||
31 | * @param string $name |
||
32 | * @param \Illuminate\Support\Collection $sitemaps |
||
33 | * @param string $format |
||
34 | * |
||
35 | * @return string|null |
||
36 | */ |
||
37 | 20 | public function build($name, $sitemaps, $format) |
|
55 | |||
56 | /* ----------------------------------------------------------------- |
||
57 | | Other Methods |
||
58 | | ----------------------------------------------------------------- |
||
59 | */ |
||
60 | |||
61 | /** |
||
62 | * Build a single sitemap item. |
||
63 | * |
||
64 | * @param string $format |
||
65 | * @param \Arcanedev\LaravelSitemap\Contracts\Entities\Sitemap|null $sitemap |
||
66 | * @param string|null $key |
||
67 | * |
||
68 | * @return string|null |
||
69 | */ |
||
70 | 16 | protected function renderSitemap($format, $sitemap, $key = null) |
|
84 | |||
85 | /** |
||
86 | * Render sitemap index. |
||
87 | * |
||
88 | * @param string $format |
||
89 | * @param \Illuminate\Support\Collection $sitemaps |
||
90 | * |
||
91 | * @return null|string |
||
92 | */ |
||
93 | 14 | protected function renderSitemapIndex($format, $sitemaps) |
|
97 | |||
98 | /** |
||
99 | * Render the file. |
||
100 | * |
||
101 | * @param string $format |
||
102 | * @param string $type |
||
103 | * @param array $data |
||
104 | * |
||
105 | * @return null|string |
||
106 | */ |
||
107 | 18 | protected function render($format, $type, array $data) |
|
121 | |||
122 | protected function renderXml($format, $type, $data) |
||
132 | |||
133 | /** |
||
134 | * Render with illuminate. |
||
135 | * |
||
136 | * @param string $type |
||
137 | * @param string $format |
||
138 | * @param array $data |
||
139 | * |
||
140 | * @return string |
||
141 | */ |
||
142 | 16 | protected function renderView($type, $format, array $data) |
|
146 | } |
||
147 |