| 1 | <?php |
||
| 14 | class Sitemap |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * The resources that make up the sitemap collection. |
||
| 18 | * |
||
| 19 | * @see SitemapResource |
||
| 20 | * @var array |
||
| 21 | */ |
||
| 22 | protected $resources; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Sitemap constructor. |
||
| 26 | * |
||
| 27 | * @param array $entries |
||
| 28 | */ |
||
| 29 | 8 | public function __construct(array $entries = []) |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Add a new sitemap entry into the sitemap collection. |
||
| 38 | * |
||
| 39 | * @param SitemapResource $sitemapResource |
||
| 40 | * |
||
| 41 | * @return Sitemap |
||
| 42 | */ |
||
| 43 | 1 | public function addResource(SitemapResource $sitemapResource): Sitemap |
|
| 49 | |||
| 50 | /** |
||
| 51 | * Retrieve all of the sitemap resources that have |
||
| 52 | * been associated to the collection. |
||
| 53 | * |
||
| 54 | * @see SitemapResource |
||
| 55 | * @return array |
||
| 56 | */ |
||
| 57 | 3 | public function getResources(): array |
|
| 61 | |||
| 62 | /** |
||
| 63 | * Validate that an array of sitemap resources is valid. |
||
| 64 | * |
||
| 65 | * @param array $sitemapResources |
||
| 66 | * |
||
| 67 | * @throws SitemapException |
||
| 68 | */ |
||
| 69 | 8 | protected function validateSitemapResources(array $sitemapResources) |
|
| 77 | } |
||
| 78 |