Esempio n. 1
0
 /**
  * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement
  *     $xmlElement)
  * @return CultureFeed_Cdb_Data_Calendar_Exceptions
  */
 public static function parseFromCdbXml(SimpleXMLElement $xmlElement)
 {
     $exceptions = new CultureFeed_Cdb_Data_Calendar_Exceptions();
     foreach ($xmlElement->timestamp as $timestampElement) {
         $exceptions->add(CultureFeed_Cdb_Data_Calendar_Timestamp::parseFromCdbXml($timestampElement));
     }
     return $exceptions;
 }
Esempio n. 2
0
 /**
  * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement $xmlElement)
  * @return CultureFeed_Cdb_Data_PeriodList
  */
 public static function parseFromCdbXml(SimpleXMLElement $xmlElement)
 {
     $timestampList = new CultureFeed_Cdb_Data_Calendar_TimestampList();
     if (!empty($xmlElement->timestamp)) {
         foreach ($xmlElement->timestamp as $timestampElement) {
             $timestampList->add(CultureFeed_Cdb_Data_Calendar_Timestamp::parseFromCdbXml($timestampElement));
         }
     }
     return $timestampList;
 }
Esempio n. 3
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;
 }