Пример #1
0
 function ErrorParams()
 {
     switch ($this->error) {
         case self::ParseFailed:
             return array($this->format);
         case self::TooEarly:
             return array($this->minDate->ToString($this->format));
         case self::TooLate:
             return array($this->maxDate->ToString($this->format));
     }
     return parent::ErrorParams();
 }
Пример #2
0
 /**
  * 
  * @param System\Date $value
  * @return string
  */
 private function _ToDBString(System\Date $value = null)
 {
     if ($value === null) {
         return $value;
     }
     return $value->ToString('Y-m-d H:i:s');
 }
Пример #3
0
 /**
  * Adds an url to the sitemap
  * @param string $url
  * @param ChangeFrequency $changeFreq
  * @param float $priority
  * @param Date $lastMod
  */
 function AddUrl($url, ChangeFrequency $changeFreq = null, $priority = null, Date $lastMod = null)
 {
     $elm = $this->domDoc->createElement("url");
     $this->AppendTextChild($elm, "loc", $url);
     if ($changeFreq) {
         $this->AppendTextChild($elm, "changefreq", (string) $changeFreq);
     }
     if ($priority) {
         $this->AppendTextChild($elm, "priority", $priority);
     }
     if ($lastMod) {
         $this->AppendTextChild($elm, "lastmod", $lastMod->ToString('c'));
     }
     $this->urlset->appendChild($elm);
 }