/**
  * @param CultureFeed_SimpleXMLElement $object
  * @return CultureFeed_Uitpas_Passholder_CardSystemSpecific
  */
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     $cardSystemSpecific = new self();
     $cardSystemSpecific->cardSystem = CultureFeed_Uitpas_CardSystem::createFromXml($object->xpath('cardSystem', false));
     $currentCard = $object->xpath('currentCard', false);
     if ($currentCard instanceof CultureFeed_SimpleXMLElement) {
         $cardSystemSpecific->currentCard = CultureFeed_Uitpas_Passholder_Card::createFromXML($currentCard);
     }
     $cardSystemSpecific->emailPreference = $object->xpath_str('emailPreference');
     $cardSystemSpecific->smsPreference = $object->xpath_str('smsPreference');
     $cardSystemSpecific->kansenStatuut = $object->xpath_bool('kansenStatuut');
     $cardSystemSpecific->kansenStatuutExpired = $object->xpath_bool('kansenStatuutExpired');
     $cardSystemSpecific->kansenStatuutEndDate = $object->xpath_time('kansenStatuutEndDate');
     $cardSystemSpecific->kansenStatuutInGracePeriod = $object->xpath_bool('kansenStatuutInGracePeriod');
     $cardSystemSpecific->status = $object->xpath_str('status');
     return $cardSystemSpecific;
 }
Ejemplo n.º 2
0
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     $promotion = new CultureFeed_Uitpas_Passholder_PointsPromotion();
     $promotion->id = $object->xpath_int('id');
     $promotion->inSpotlight = $object->xpath_bool('inSpotlight');
     $promotion->title = $object->xpath_str('title');
     $promotion->description1 = $object->xpath_str('description1');
     $promotion->description2 = $object->xpath_str('description2');
     $promotion->pictures = $object->xpath_str('pictures/picture', TRUE);
     if (NULL === $promotion->pictures) {
         $promotion->pictures = array();
     }
     $promotion->publicationPeriodBegin = $object->xpath_time('publicationPeriodBegin');
     $promotion->publicationPeriodEnd = $object->xpath_time('publicationPeriodEnd');
     $promotion->points = $object->xpath_int('points');
     $promotion->cashedIn = $object->xpath_bool('cashedIn');
     $promotion->counters = array();
     foreach ($object->xpath('balies/balie') as $counter) {
         $promotion->counters[] = CultureFeed_Uitpas_Passholder_Counter::createFromXML($counter);
     }
     $promotion->creationDate = $object->xpath_time('creationDate');
     $promotion->cashingPeriodBegin = $object->xpath_time('cashingPeriodBegin');
     $promotion->cashingPeriodEnd = $object->xpath_time('cashingPeriodEnd');
     $promotion->validForCities = $object->xpath_str('validForCities/city', TRUE);
     if (NULL === $promotion->validForCities) {
         $promotion->validForCities = array();
     }
     $promotion->maxAvailableUnits = $object->xpath_int('maxAvailableUnits');
     $promotion->unitsTaken = $object->xpath_int('unitsTaken');
     $promotion->cashInState = $object->xpath_str('cashInState');
     $periodConstraint = $object->xpath('periodConstraint', FALSE);
     if (!empty($periodConstraint)) {
         $promotion->periodConstraint = CultureFeed_Uitpas_Passholder_PeriodConstraint::createFromXml($periodConstraint);
     }
     $owningCardSystem = $object->xpath('owningCardSystem', FALSE);
     if ($owningCardSystem instanceof CultureFeed_SimpleXMLElement) {
         $promotion->owningCardSystem = CultureFeed_Uitpas_CardSystem::createFromXml($owningCardSystem);
     }
     $applicableCardSystems = $object->xpath('applicableCardSystems/cardsystem');
     foreach ($applicableCardSystems as $applicableCardSystem) {
         $promotion->applicableCardSystems[] = CultureFeed_Uitpas_CardSystem::createFromXml($applicableCardSystem);
     }
     return $promotion;
 }
Ejemplo n.º 3
0
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     $counter = new CultureFeed_Uitpas_Counter();
     $counter->id = $object->xpath_str('id');
     $counter->name = $object->xpath_str('name');
     $counter->type = $object->xpath_str('type');
     $counter->street = $object->xpath_str('street');
     $counter->number = $object->xpath_int('number');
     $counter->box = $object->xpath_str('box');
     $counter->postalCode = $object->xpath_str('postalCode');
     $counter->city = $object->xpath_str('city');
     $counter->cityPart = $object->xpath_str('cityPart');
     $counter->telephoneNumber = $object->xpath_str('telephoneNumber');
     $counter->contactPerson = $object->xpath_str('contactPerson');
     $counter->consumerKey = $object->xpath_str('consumerKey');
     foreach ($object->xpath('cardSystems/cardSystem') as $card_system) {
         $cardSystem = CultureFeed_Uitpas_CardSystem::createFromXml($card_system);
         $counter->cardSystems[$cardSystem->id] = $cardSystem;
     }
     return $counter;
 }
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     $welcome_advantage = new CultureFeed_Uitpas_Passholder_WelcomeAdvantage();
     $welcome_advantage->id = $object->xpath_int('id');
     $welcome_advantage->title = $object->xpath_str('title');
     $welcome_advantage->description1 = $object->xpath_str('description1');
     $welcome_advantage->description2 = $object->xpath_str('description2');
     $welcome_advantage->pictures = $object->xpath_str('pictures/picture', TRUE);
     if (NULL === $welcome_advantage->pictures) {
         $welcome_advantage->pictures = array();
     }
     $welcome_advantage->publicationPeriodBegin = $object->xpath_time('publicationPeriodBegin');
     $welcome_advantage->publicationPeriodEnd = $object->xpath_time('publicationPeriodEnd');
     $welcome_advantage->points = $object->xpath_int('points');
     $welcome_advantage->cashedIn = $object->xpath_bool('cashedIn');
     $welcome_advantage->cashingDate = $object->xpath_time('cashingDate');
     foreach ($object->xpath('balies/balie') as $counter) {
         $welcome_advantage->counters[] = CultureFeed_Uitpas_Passholder_Counter::createFromXML($counter);
     }
     $welcome_advantage->creationDate = $object->xpath_time('creationDate');
     $welcome_advantage->cashingPeriodBegin = $object->xpath_time('cashingPeriodBegin');
     $welcome_advantage->cashingPeriodEnd = $object->xpath_time('cashingPeriodEnd');
     $welcome_advantage->grantingPeriodBegin = $object->xpath_time('grantingPeriodBegin');
     $welcome_advantage->grantingPeriodEnd = $object->xpath_time('grantingPeriodEnd');
     $welcome_advantage->cashingPeriodBegin = $object->xpath_time('cashingPeriodBegin');
     $welcome_advantage->validForCities = $object->xpath_str('validForCities/city', true);
     if (NULL === $welcome_advantage->validForCities) {
         $welcome_advantage->validForCities = array();
     }
     $welcome_advantage->maxAvailableUnits = $object->xpath_int('maxAvailableUnits');
     $welcome_advantage->unitsTaken = $object->xpath_int('unitsTaken');
     $owningCardSystem = $object->xpath('owningCardSystem', FALSE);
     if ($owningCardSystem instanceof CultureFeed_SimpleXMLElement) {
         $welcome_advantage->owningCardSystem = CultureFeed_Uitpas_CardSystem::createFromXml($owningCardSystem);
     }
     $applicableCardSystems = $object->xpath('applicableCardSystems/cardsystem');
     foreach ($applicableCardSystems as $applicableCardSystem) {
         $welcome_advantage->applicableCardSystems[] = CultureFeed_Uitpas_CardSystem::createFromXml($applicableCardSystem);
     }
     return $welcome_advantage;
 }