for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\CoreBundle\Sitemap\Model;
use Sylius\Bundle\CoreBundle\Sitemap\Exception\SitemapUrlNotFoundException;
/**
* @author Arkadiusz Krakowiak <[email protected]>
class Sitemap implements SitemapInterface
{
* @var array
private $urls = [];
* @var string
private $localization;
* @var \DateTime
private $lastModification;
* {@inheritdoc}
public function setUrls(array $urls)
$this->urls = $urls;
}
public function getUrls()
return $this->urls;
public function addUrl(SitemapUrlInterface $url)
$this->urls[] = $url;
public function removeUrl(SitemapUrlInterface $url)
$key = array_search($url, $this->urls, true);
if (false === $key) {
throw new SitemapUrlNotFoundException($url);
unset($this->urls[$key]);
public function setLocalization($localization)
$this->localization = $localization;
public function getLocalization()
return $this->localization;
public function setLastModification(\DateTime $lastModification)
$this->lastModification = $lastModification;
public function getLastModification()
return $this->lastModification;