Ejemplo n.º 1
0
 /**
  * @param string $link
  *
  * @return $this
  *
  * @throws SitemapException
  */
 public function setLink($link)
 {
     if (false === ValidatorTrait::validateLoc($link)) {
         throw new SitemapException('Value for setLink is not a valid URL');
     }
     $this->link = "<link>{$link}</link>";
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * @param string $url
  *
  * @throws SitemapException
  */
 protected function validateLoc($url)
 {
     if (false === ValidatorTrait::validateLoc($url)) {
         throw new SitemapException(\sprintf('Provided url is not valid.'));
     }
 }