Example #1
0
 /**
  * Convert a FormalDate to a string
  * @return string
  */
 public function __toString()
 {
     $result = array();
     if ($this->isRecurring) {
         $result[] = "R";
         if ($this->numRepetitions !== null) {
             $result[] = $this->numRepetitions;
         }
         $result[] = "/";
     } elseif ($this->isApproximate) {
         $result[] = "A";
     }
     if ($this->start !== null) {
         $result[] = $this->start->__toString();
     }
     if ($this->isRange) {
         $result[] = "/";
     }
     if ($this->end !== null) {
         $result[] = $this->end->__toString();
     } elseif ($this->duration !== null) {
         $result[] = $this->duration->__toString();
     }
     return implode("", $result);
 }