Пример #1
0
 public function update(Event $event)
 {
     $urlLoc = $event->get('loc');
     if (!$this->sitemap->has($urlLoc)) {
         throw new Exception\OutOfBoundsException('Url ' . $urlLoc . ' could not be found.');
     }
     $url = $this->sitemap->get($urlLoc);
     $time = new \DateTime();
     $lastmod = $url->getLastmod();
     $url->setLastmod($time);
     $url->setChangefreq($this->getChangefreq($time->diff(\DateTime::createFromFormat(Url::LASTMOD_FORMAT, $lastmod))));
     $this->dump($this->sitemap);
 }