Esempio n. 1
0
 /**
  * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement
  *     $xmlElement)
  * @return CultureFeed_Cdb_Data_Calendar_Timestamp
  */
 public static function parseFromCdbXml(SimpleXMLElement $xmlElement)
 {
     if (empty($xmlElement->date)) {
         throw new CultureFeed_Cdb_ParseException("Date is missing for timestamp");
     }
     $attributes = $xmlElement->attributes();
     $timestamp = new CultureFeed_Cdb_Data_Calendar_Timestamp((string) $xmlElement->date);
     if (isset($attributes['opentype'])) {
         $timestamp->setOpenType((string) $attributes['opentype']);
     }
     if (!empty($xmlElement->timestart)) {
         $timestamp->setStartTime((string) $xmlElement->timestart);
     }
     if (!empty($xmlElement->timeend)) {
         $timestamp->setEndTime((string) $xmlElement->timeend);
     }
     return $timestamp;
 }