/** * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement * $xmlElement) * @throws CultureFeed_Cdb_ParseException * @return CultureFeed_Cdb_Item_Actor */ public static function parseFromCdbXml(SimpleXMLElement $xmlElement) { if (empty($xmlElement->categories)) { throw new CultureFeed_Cdb_ParseException('Categories missing for actor element'); } if (empty($xmlElement->actordetails)) { throw new CultureFeed_Cdb_ParseException('Actordetails missing for actor element'); } $actor = new self(); CultureFeed_Cdb_Item_Base::parseCommonAttributes($actor, $xmlElement); $actor->setDetails(CultureFeed_Cdb_Data_ActorDetailList::parseFromCdbXml($xmlElement->actordetails)); // Set categories $actor->setCategories(CultureFeed_Cdb_Data_CategoryList::parseFromCdbXml($xmlElement->categories)); // Set contact information. if (!empty($xmlElement->contactinfo)) { $actor->setContactInfo(CultureFeed_Cdb_Data_ContactInfo::parseFromCdbXml($xmlElement->contactinfo)); } // Set the keywords. self::parseKeywords($xmlElement, $actor); // Set the weekscheme. if (!empty($xmlElement->weekscheme)) { $actor->setWeekScheme(CultureFeed_Cdb_Data_Calendar_Weekscheme::parseFromCdbXml($xmlElement->weekscheme)); } return $actor; }
/** * @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; }
/** * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement $xmlElement) * @return CultureFeed_Cdb_Item_Actor */ public static function parseFromCdbXml(SimpleXMLElement $xmlElement) { if (empty($xmlElement->categories)) { throw new CultureFeed_Cdb_ParseException('Categories missing for actor element'); } if (empty($xmlElement->actordetails)) { throw new CultureFeed_Cdb_ParseException('Actordetails missing for actor element'); } $actor = new self(); $actor_attributes = $xmlElement->attributes(); if (isset($actor_attributes['cdbid'])) { $actor->setCdbId((string) $actor_attributes['cdbid']); } if (isset($actor_attributes['externalid'])) { $actor->setExternalId((string) $actor_attributes['externalid']); } if (isset($actor_attributes['availablefrom'])) { $actor->setAvailableFrom((string) $actor_attributes['availablefrom']); } if (isset($actor_attributes['availableto'])) { $actor->setAvailableTo((string) $actor_attributes['availableto']); } if (isset($actor_attributes['createdby'])) { $actor->setCreatedBy((string) $actor_attributes['createdby']); } if (isset($actor_attributes['creationdate'])) { $actor->setCreationDate((string) $actor_attributes['creationdate']); } if (isset($actor_attributes['lastupdated'])) { $actor->setLastUpdated((string) $actor_attributes['lastupdated']); } if (isset($actor_attributes['lastupdatedby'])) { $actor->setLastUpdatedBy((string) $actor_attributes['lastupdatedby']); } if (isset($actor_attributes['owner'])) { $actor->setOwner((string) $actor_attributes['owner']); } $actor->setDetails(CultureFeed_Cdb_Data_ActorDetailList::parseFromCdbXml($xmlElement->actordetails)); // Set categories $actor->setCategories(CultureFeed_Cdb_Data_CategoryList::parseFromCdbXml($xmlElement->categories)); // Set contact information. if (!empty($xmlElement->contactinfo)) { $actor->setContactInfo(CultureFeed_Cdb_Data_ContactInfo::parseFromCdbXml($xmlElement->contactinfo)); } // Set the keywords. self::parseKeywords($xmlElement, $actor); // Set the weekscheme. if (!empty($xmlElement->weekscheme)) { $actor->setWeekScheme(CultureFeed_Cdb_Data_Calendar_Weekscheme::parseFromCdbXml($xmlElement->weekscheme)); } return $actor; }
/** * @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; }