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 | 18 | public static function make() |
|
27 | |||
28 | /** |
||
29 | * @param string $name |
||
30 | * @param \Illuminate\Support\Collection $sitemaps |
||
31 | * @param string $format |
||
32 | * |
||
33 | * @return string|null |
||
34 | */ |
||
35 | 18 | public function build($name, $sitemaps, $format) |
|
53 | |||
54 | /* ----------------------------------------------------------------- |
||
55 | | Other Methods |
||
56 | | ----------------------------------------------------------------- |
||
57 | */ |
||
58 | |||
59 | /** |
||
60 | * Build a single sitemap item. |
||
61 | * |
||
62 | * @param string $format |
||
63 | * @param \Arcanedev\LaravelSitemap\Contracts\Entities\Sitemap|null $sitemap |
||
64 | * @param string|null $key |
||
65 | * |
||
66 | * @return string|null |
||
67 | */ |
||
68 | 14 | protected function renderSitemap($format, $sitemap, $key = null) |
|
82 | |||
83 | /** |
||
84 | * Render sitemap index. |
||
85 | * |
||
86 | * @param string $format |
||
87 | * @param \Illuminate\Support\Collection $sitemaps |
||
88 | * |
||
89 | * @return null|string |
||
90 | */ |
||
91 | 12 | protected function renderSitemapIndex($format, $sitemaps) |
|
95 | |||
96 | /** |
||
97 | * Render the file. |
||
98 | * |
||
99 | * @param string $format |
||
100 | * @param string $type |
||
101 | * @param array $data |
||
102 | * |
||
103 | * @return null|string |
||
104 | */ |
||
105 | 16 | protected function render($format, $type, array $data) |
|
119 | |||
120 | protected function renderXml($format, $type, $data) |
||
130 | |||
131 | /** |
||
132 | * Render with illuminate. |
||
133 | * |
||
134 | * @param string $type |
||
135 | * @param string $format |
||
136 | * @param array $data |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | 14 | protected function renderView($type, $format, array $data) |
|
144 | } |
||
145 |