Beispiel #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;
 }
Beispiel #2
0
 /**
  * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement $xmlElement)
  * @return CultureFeed_Cdb_Data_Calendar_Permanent
  */
 public static function parseFromCdbXml(SimpleXMLElement $xmlElement)
 {
     if (!isset($xmlElement->permanentopeningtimes->permanent)) {
         throw new CultureFeed_Cdb_ParseException("Permanent data is missing for permanent opening times");
     }
     $permanentXml = $xmlElement->permanentopeningtimes->permanent;
     $calendar = new CultureFeed_Cdb_Data_Calendar_Permanent();
     if (!empty($permanentXml->weekscheme)) {
         $calendar->setWeekScheme(CultureFeed_Cdb_Data_Calendar_Weekscheme::parseFromCdbXml($permanentXml->weekscheme));
     }
     if (!empty($permanentXml->exceptions)) {
         $calendar->setExceptions(CultureFeed_Cdb_Data_Calendar_Exceptions::parseFromCdbXml($permanentXml->exceptions));
     }
     return $calendar;
 }
Beispiel #3
0
 /**
  * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement
  *     $xmlElement)
  * @return CultureFeed_Cdb_Data_Calendar_Period
  */
 public static function parseFromCdbXml(SimpleXMLElement $xmlElement)
 {
     if (empty($xmlElement->datefrom)) {
         throw new CultureFeed_Cdb_ParseException("Date from is missing for period");
     }
     if (empty($xmlElement->dateto)) {
         throw new CultureFeed_Cdb_ParseException("Date to is missing for period");
     }
     $period = new CultureFeed_Cdb_Data_Calendar_Period((string) $xmlElement->datefrom, (string) $xmlElement->dateto);
     if (!empty($xmlElement->weekscheme)) {
         $period->setWeekScheme(CultureFeed_Cdb_Data_Calendar_Weekscheme::parseFromCdbXml($xmlElement->weekscheme));
     }
     if (!empty($xmlElement->exceptions)) {
         $period->setExceptions(CultureFeed_Cdb_Data_Calendar_Exceptions::parseFromCdbXml($xmlElement->exceptions));
     }
     return $period;
 }