public static function createFromXML(CultureFeed_SimpleXMLElement $xml)
 {
     $eventActions = new self();
     $eventActions->passholder = CultureFeed_Uitpas_Passholder::createFromXML($xml->xpath('passHolder', FALSE));
     $eventActions->welcomeAdvantages = CultureFeed_Uitpas_Passholder_WelcomeAdvantageResultSet::createFromXML($xml->xpath('welcomeAdvantages', FALSE), 'welcomeAdvantage');
     $eventActions->pointsPromotions = CultureFeed_Uitpas_Passholder_PointsPromotionResultSet::createFromXML($xml->xpath('pointsPromotions', FALSE), 'pointsPromotion');
     $eventCheckin = $xml->xpath('eventCheckin', FALSE);
     if ($eventCheckin instanceof CultureFeed_SimpleXMLElement) {
         $eventActions->eventCheckin = CultureFeed_Uitpas_Passholder_EventCheckin::createFromXML($eventCheckin);
     }
     $eventBuyTicket = $xml->xpath('eventBuyTicket', FALSE);
     if ($eventBuyTicket instanceof CultureFeed_SimpleXMLElement) {
         $eventActions->eventBuyTicket = CultureFeed_Uitpas_Passholder_EventBuyTicket::createFromXML($eventBuyTicket);
     }
     return $eventActions;
 }
示例#2
0
 /**
  * Search for welcome advantages.
  *
  * @param CultureFeed_Uitpas_Promotion_Query_WelcomeAdvantagesOptions $query The query
  * @param string $method The request method
  */
 public function searchWelcomeAdvantages(CultureFeed_Uitpas_Promotion_Query_WelcomeAdvantagesOptions $query, $method = CultureFeed_Uitpas::CONSUMER_REQUEST)
 {
     $path = 'uitpas/promotion/welcomeAdvantages';
     $data = $query->toPostData();
     if ($method == CultureFeed_Uitpas::CONSUMER_REQUEST) {
         $result = $this->oauth_client->consumerGetAsXml($path, $data);
     } else {
         $result = $this->oauth_client->authenticatedGetAsXml($path, $data);
     }
     try {
         $xml = new CultureFeed_SimpleXMLElement($result);
     } catch (Exception $e) {
         throw new CultureFeed_ParseException($result);
     }
     $promotions = CultureFeed_Uitpas_Passholder_WelcomeAdvantageResultSet::createFromXML($xml->xpath('/response', false));
     return $promotions;
 }