public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     $membership = new CultureFeed_Uitpas_Passholder_Membership();
     $membership->id = $object->xpath_str('id');
     $membership->association = CultureFeed_Uitpas_Association::createFromXML($object->xpath('association', false));
     $membership->associationId = $object->xpath_str('association/id');
     $membership->name = $object->xpath_str('association/name');
     $membership->endDate = $object->xpath_time('endDate');
     $membership->renewable = $object->xpath_bool('renewable');
     $membership->newEndDate = $object->xpath_time('newEndDate');
     $membership->renewDate = $object->xpath_time('renewDate');
     $membership->expired = $object->xpath_bool('expired');
     return $membership;
 }
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     $cardsystemPreferences = new CultureFeed_Uitpas_Passholder_CardSystemPreferences();
     $cardsystemPreferences->id = $object->xpath_str('id');
     $cardsystemPreferences->cardSystemId = $object->xpath_int('cardSystemId');
     $cardsystemPreferences->emailPreference = $object->xpath_str('emailPreference');
     $cardsystemPreferences->smsPreference = $object->xpath_str('smsPreference');
     $cardsystemPreferences->kansenStatuutEndDate = $object->xpath_time('kansenStatuutEndDate');
     return $cardsystemPreferences;
 }
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     // TODO: implement properly
     $promotion = new CultureFeed_Uitpas_Passholder_CashedInPointsPromotion();
     $promotion->id = $object->xpath_int('promotion/id');
     $promotion->title = $object->xpath_str('promotion/title');
     $promotion->points = $object->xpath_int('promotion/points');
     $promotion->cashingDate = $object->xpath_time('cashingDate');
     $promotion->location = $object->xpath_str('balie/name');
     $promotion->counters = array(CultureFeed_Uitpas_Passholder_Counter::createFromXML($object->balie));
     return $promotion;
 }
Example #4
0
 /**
  * @param CultureFeed_SimpleXMLElement $object
  * @return CultureFeed_Uitpas_Event_TicketSale_Coupon
  */
 public static function createFromXml(CultureFeed_SimpleXMLElement $object)
 {
     $coupon = new CultureFeed_Uitpas_Event_TicketSale_Coupon();
     $coupon->id = $object->xpath_str('id', FALSE);
     $coupon->name = $object->xpath_str('name', FALSE);
     $coupon->description = $object->xpath_str('description', FALSE);
     $coupon->validFrom = $object->xpath_time('validFrom');
     $coupon->validTo = $object->xpath_time('validTo');
     $exchangeConstraintElement = $object->xpath('exchangeConstraint', FALSE);
     if ($exchangeConstraintElement instanceof CultureFeed_SimpleXMLElement) {
         $coupon->exchangeConstraint = CultureFeed_Uitpas_PeriodConstraint::createFromXML($exchangeConstraintElement);
     }
     $buyConstraintElement = $object->xpath('buyConstraint', FALSE);
     if ($buyConstraintElement instanceof CultureFeed_SimpleXMLElement) {
         $coupon->buyConstraint = CultureFeed_Uitpas_PeriodConstraint::createFromXML($buyConstraintElement);
     }
     $remainingTotalElement = $object->xpath('remainingTotal', FALSE);
     if ($remainingTotalElement instanceof CultureFeed_SimpleXMLElement) {
         $coupon->remainingTotal = CultureFeed_Uitpas_PeriodConstraint::createFromXML($remainingTotalElement);
     }
     return $coupon;
 }
 /**
  * @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;
 }
 /**
  * @param CultureFeed_SimpleXMLElement $object
  *
  * @return static
  */
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     $instance = new static();
     $instance->id = $object->xpath_int('id');
     $instance->name = $object->xpath_str('name');
     foreach ($object->xpath('cardSystems/cardSystem') as $cardSystemNode) {
         $instance->cardSystems[] = CultureFeed_Uitpas_CardSystem::createFromXML($cardSystemNode);
     }
     $instance->permissionRead = $object->xpath_bool('permissionRead');
     $instance->permissionRegister = $object->xpath_bool('permissionRegister');
     $instance->enddateCalculation = $object->xpath_str('enddateCalculation');
     switch ($instance->enddateCalculation) {
         case CultureFeed_Uitpas_EndDateCalculation::FREE:
             $instance->enddateCalculationFreeDate = $object->xpath_time('enddateCalculationFreeDate');
             break;
         case CultureFeed_Uitpas_EndDateCalculation::BASED_ON_REGISTRATION_DATE:
         case CultureFeed_Uitpas_EndDateCalculation::BASED_ON_DATE_OF_BIRTH:
             $instance->enddateCalculationValidityTime = $object->xpath_int('enddateCalculationValidityTime');
             break;
         default:
     }
     return $instance;
 }
 /**
  * Instantiates a new checkin activity object based on the passed XML representation.
  *
  * @param CultureFeed_SimpleXMLElement $object
  * @return CultureFeed_Uitpas_Event_CheckinActivity
  */
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     $checkin = new CultureFeed_Uitpas_Event_CheckinActivity();
     $checkin->id = $object->xpath_str('id');
     $checkin->nodeId = $object->xpath_str('nodeID');
     $checkin->nodeTitle = $object->xpath_str('nodeTitle');
     $checkin->private = $object->xpath_bool('private');
     $checkin->createdVia = $object->xpath_str('createdVia');
     $checkin->points = $object->xpath_int('points');
     $checkin->contentType = $object->xpath_str('contentType');
     $checkin->type = $object->xpath_str('type');
     $checkin->value = $object->xpath_str('value');
     $checkin->userId = $object->xpath_str('userId');
     $checkin->depiction = $object->xpath_str('depiction');
     $checkin->nick = $object->xpath_str('nick');
     $checkin->creationDate = $object->xpath_time('creationDate');
     $checkin->kansenStatuut = $object->xpath_bool('kansenStatuut');
     $checkin->location = $object->xpath_str('location');
     $checkin->organiser = $object->xpath_str('organiser');
     $checkin->userHomeCity = $object->xpath_str('userHomeCity');
     $checkin->userHomeLocationLat = $object->xpath_float('userHomeLocationLat');
     $checkin->userHomeLocationLon = $object->xpath_float('userHomeLocationLon');
     $checkin->firstName = $object->xpath_str('firstName');
     $checkin->lastName = $object->xpath_str('lastName');
     $checkin->userPoints = $object->xpath_int('userPoints');
     $checkin->eventLocationLat = $object->xpath_float('eventLocationLat');
     $checkin->eventLocationLon = $object->xpath_float('eventLocationLon');
     $checkin->gender = $object->xpath_str('gender');
     $organiserCardSystems = $object->xpath('organiserCardSystems/organiserCardSystem');
     foreach ($organiserCardSystems as $organiserCardSystemId) {
         $checkin->organiserCardSystems[] = (int) dom_import_simplexml($organiserCardSystemId)->textContent;
     }
     return $checkin;
 }
Example #8
0
 /**
  * Parse a message from an xml element.
  * @param unknown $xmlElement
  */
 public static function parseFromXml(CultureFeed_SimpleXMLElement $xmlElement)
 {
     $message = new self();
     // General properties.
     $message->id = $xmlElement->xpath_str('id');
     $message->type = $xmlElement->xpath_str('type');
     $message->status = $xmlElement->xpath_str('status');
     $message->creationDate = $xmlElement->xpath_time('creationDate');
     $message->lastReply = $xmlElement->xpath_time('lastReply');
     $message->subject = $xmlElement->xpath_str('subject');
     $message->body = $xmlElement->xpath_str('body');
     $message->role = $xmlElement->xpath_str('role');
     // Parse sender.
     $user = new CultureFeed_User();
     $user->id = $xmlElement->xpath_str('sender/rdf:id');
     $user->nick = $xmlElement->xpath_str('sender/foaf:nick');
     $user->depiction = $xmlElement->xpath_str('sender/foaf:depiction');
     $message->sender = $user;
     // Parse recipients.
     $message->recipients = array();
     $recipientElements = $xmlElement->xpath('recipients/recipient');
     if ($recipientElements) {
         foreach ($recipientElements as $recipientElement) {
             $recipient = new CultureFeed_User();
             $recipient->id = $recipientElement->xpath_str('rdf:id');
             $recipient->nick = $recipientElement->xpath_str('foaf:nick');
             $recipient->depiction = $recipientElement->xpath_str('foaf:depiction');
             $message->recipients[$recipient->id] = $recipient;
         }
     }
     $senderPageId = $xmlElement->xpath_str('senderPageId');
     if ($senderPageId) {
         $page = new CultureFeed_Cdb_Item_Page();
         $page->setId($senderPageId);
         $page->setName($xmlElement->xpath_str('senderPageName'));
         $message->senderPage = $page;
     }
     $recipientPageId = $xmlElement->xpath_str('recipientPageId');
     if ($recipientPageId) {
         $page = new CultureFeed_Cdb_Item_Page();
         $page->setId($recipientPageId);
         $page->setName($xmlElement->xpath_str('recipientPageName'));
         $message->recipientPage = $page;
     }
     // If this is a thread, parse also the child messages.
     $message->children = array();
     $childElements = $xmlElement->xpath('children/message');
     if ($childElements) {
         foreach ($childElements as $childElement) {
             $message->children[] = CultureFeed_Messages_Message::parseFromXml($childElement);
         }
     }
     return $message;
 }
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     $event = new CultureFeed_Uitpas_Event_CultureEvent();
     $event->cdbid = $object->xpath_str('cdbid');
     $event->locationId = $object->xpath_str('locationId');
     $event->locationName = $object->xpath_str('locationName');
     $event->organiserId = $object->xpath_str('organiserId');
     $event->organiserName = $object->xpath_str('organiserName');
     $event->city = $object->xpath_str('city');
     $event->checkinAllowed = $object->xpath_bool('checkinAllowed');
     $event->checkinConstraint = CultureFeed_Uitpas_Event_CheckinConstraint::createFromXML($object->xpath('checkinConstraint', false));
     $event->checkinConstraintReason = $object->xpath_str('checkinConstraintReason');
     $event->checkinStartDate = $object->xpath_time('checkinStartDate');
     $event->checkinEndDate = $object->xpath_time('checkinEndDate');
     $event->buyConstraintReason = $object->xpath_str('buyConstraintReason');
     $event->price = $object->xpath_float('price');
     $event->tariff = $object->xpath_float('tariff');
     $event->title = $object->xpath_str('title');
     $object->registerXPathNamespace('cdb', CultureFeed_Cdb_Default::CDB_SCHEME_URL);
     $calendar_xml = $object->xpath('cdb:calendar', false);
     if (!empty($calendar_xml)) {
         $event->calendar = CultureFeed_Uitpas_Calendar::createFromXML($calendar_xml);
     }
     $event->numberOfPoints = $object->xpath_int('numberOfPoints');
     $event->gracePeriodMonths = $object->xpath_int('gracePeriodMonths');
     $event->cardSystems = array();
     foreach ($object->xpath('cardSystems/cardSystem') as $cardSystem) {
         $event->cardSystems[] = CultureFeed_Uitpas_CardSystem::createFromXML($cardSystem);
     }
     $event->ticketSales = array();
     foreach ($object->xpath('ticketSales/ticketSale') as $ticketSale) {
         $event->ticketSales[] = CultureFeed_Uitpas_Event_TicketSale_Opportunity::createFromXml($ticketSale);
     }
     $event->distributionKey = array();
     foreach ($object->xpath('distributionKeys/distributionKey') as $distributionKey) {
         $event->distributionKey[] = CultureFeed_Uitpas_DistributionKey::createFromXML($distributionKey);
     }
     return $event;
 }
 /**
  * Initializes a CultureFeed_PointsPromotion object from its XML representation.
  *
  * @param CultureFeed_SimpleXMLElement $element
  * @return CultureFeed_PointsPromotion
  */
 public static function parseFromXML(CultureFeed_SimpleXMLElement $element)
 {
     if (empty($element->id)) {
         throw new CultureFeed_ParseException('id missing for PointsPromotions element');
     }
     if (empty($element->title)) {
         throw new CultureFeed_ParseException('title missing for PointsPromotions element');
     }
     if (empty($element->points)) {
         throw new CultureFeed_ParseException('points missing for PointsPromotions element');
     }
     $pointsPromotion = new CultureFeed_PointsPromotion();
     $pointsPromotion->id = $element->xpath_str('id');
     $pointsPromotion->cashInState = $element->xpath_str('cashInState');
     $pointsPromotion->cashedIn = $element->xpath_str('cashedIn') == "true" ? TRUE : FALSE;
     $pointsPromotion->inSpotlight = $element->xpath_str('inSpotlight') == "true" ? TRUE : FALSE;
     $pointsPromotion->cashingPeriodBegin = $element->xpath_time('cashingPeriodBegin');
     $pointsPromotion->cashingPeriodEnd = $element->xpath_time('cashingPeriodEnd');
     $pointsPromotion->creationDate = $element->xpath_time('creationDate');
     $pointsPromotion->maxAvailableUnits = $element->xpath_str('maxAvailableUnits');
     $pointsPromotion->points = $element->xpath_str('points');
     $pointsPromotion->title = $element->xpath_str('title');
     $pointsPromotion->unitsTaken = $element->xpath_str('unitsTaken');
     $pointsPromotion->description1 = $element->xpath_str('description1');
     $pointsPromotion->description2 = $element->xpath_str('description2');
     // Set relations.
     if (!empty($element->pictures) && !empty($element->pictures->picture)) {
         foreach ($element->pictures->picture as $picture) {
             $pointsPromotion->pictures[] = (string) $picture;
         }
     }
     $periodType = $element->xpath_str('periodConstraint/periodType');
     $periodVolume = $element->xpath_str('periodConstraint/periodVolume');
     if (!empty($periodType) && !empty($periodVolume)) {
         $pointsPromotion->periodConstraint = new CultureFeed_PeriodConstraint($periodType, $periodVolume);
     }
     return $pointsPromotion;
 }
 protected static function parseUser(CultureFeed_SimpleXMLElement $element)
 {
     $user = new CultureFeed_User();
     $user->id = $element->xpath_str('/foaf:person/rdf:id');
     $user->preferredLanguage = $element->xpath_str('/foaf:person/preferredLanguage');
     $user->nick = $element->xpath_str('/foaf:person/foaf:nick');
     $user->givenName = $element->xpath_str('/foaf:person/foaf:givenName');
     $user->familyName = $element->xpath_str('/foaf:person/foaf:familyName');
     $user->mbox = $element->xpath_str('/foaf:person/foaf:mbox');
     $user->mboxVerified = $element->xpath_bool('/foaf:person/mboxVerified');
     $user->gender = $element->xpath_str('/foaf:person/foaf:gender');
     $user->dob = $element->xpath_time('/foaf:person/foaf:dob');
     $user->hasChildren = $element->xpath_bool('/foaf:person/hasChildren');
     $user->depiction = $element->xpath_str('/foaf:person/foaf:depiction');
     $user->bio = $element->xpath_str('/foaf:person/bio');
     $user->street = $element->xpath_str('/foaf:person/homeAddress/street');
     $user->zip = $element->xpath_str('/foaf:person/homeAddress/zip');
     $user->city = $element->xpath_str('/foaf:person/homeAddress/city');
     $user->country = $element->xpath_str('/foaf:person/homeAddress/country');
     $user->lifestyleProfile = $element->xpath_str('/foaf:person/lifestyleProfile');
     $user->status = $element->xpath_str('/foaf:person/status');
     $user->points = $element->xpath_str('/foaf:person/points');
     $user->calendarId = $element->xpath_str('/foaf:person/calendarId');
     if ($user->status) {
         $user->status = strtolower($user->status);
     }
     $user->openid = $element->xpath_str('/foaf:person/foaf:openid');
     $lat = $element->xpath_float('/foaf:person/homeLocation/geo:lat');
     $lng = $element->xpath_float('/foaf:person/homeLocation/geo:long');
     if ($lat && $lng) {
         $user->homeLocation = new CultureFeed_Location($lat, $lng);
     }
     $lat = $element->xpath_float('/foaf:person/currentLocation/geo:lat');
     $lng = $element->xpath_float('/foaf:person/currentLocation/geo:long');
     if ($lat && $lng) {
         $user->currentLocation = new CultureFeed_Location($lat, $lng);
     }
     $accounts = array();
     $objects = $element->xpath('/foaf:person/foaf:holdsAccount/foaf:onlineAccount');
     foreach ($objects as $object) {
         $account = new CultureFeed_OnlineAccount();
         $account->accountType = $object->xpath_str('accountType');
         $account->accountServiceHomepage = $object->xpath_str('foaf:accountServiceHomepage');
         $account->accountName = $object->xpath_str('foaf:accountName');
         $account->accountNick = $object->xpath_str('accountNick');
         $account->accountDepiction = $object->xpath_str('accountDepiction');
         $account->private = $object->xpath_bool('private');
         $account->publishActivities = $object->xpath_bool('publishActivities');
         $accounts[] = $account;
     }
     if ($element->xpath_str('/foaf:person/privateNick') !== NULL) {
         $privacy_config = new CultureFeed_UserPrivacyConfig();
         $vars = array('nick', 'givenName', 'familyName', 'mbox', 'gender', 'dob', 'depiction', 'bio', 'homeAddress', 'homeLocation', 'currentLocation', 'openId', 'calendarId');
         foreach ($vars as $var) {
             $privacy = $element->xpath_bool('/foaf:person/private' . ucfirst($var));
             if (is_bool($privacy)) {
                 $privacy_config->{$var} = $privacy ? CultureFeed_UserPrivacyConfig::PRIVACY_PRIVATE : CultureFeed_UserPrivacyConfig::PRIVACY_PUBLIC;
             }
         }
         $user->privacyConfig = $privacy_config;
     }
     if (!empty($accounts)) {
         $user->holdsAccount = $accounts;
     }
     // Add memberships.
     $memberships = $element->xpath('/foaf:person/pageMemberships/pageMembership');
     $user_memberships = array();
     foreach ($memberships as $membership) {
         $pageId = $membership->xpath_str('page/uid');
         if (empty($pageId)) {
             continue;
         }
         $user_membership = new CultureFeed_Pages_Membership();
         $page = new CultureFeed_Cdb_Item_Page();
         $page->setId($pageId);
         $page->setName($membership->xpath_str('page/name'));
         // Set categories
         $categories_element = $membership->xpath('page/categoryIds/categoryId');
         $categories = array();
         foreach ($categories_element as $category) {
             $categories[] = (string) $category;
         }
         $page->setCategories($categories);
         $user_membership->page = $page;
         $user_membership->validated = $membership->xpath_bool('validated');
         $user_membership->role = $membership->xpath_str('role');
         $user_membership->relation = $membership->xpath_str('relation');
         $user_membership->creationDate = $membership->xpath_time('creationDate');
         $user_memberships[] = $user_membership;
     }
     if (!empty($user_memberships)) {
         $user->pageMemberships = $user_memberships;
         $adminPagesCount = 0;
         foreach ($user->pageMemberships as $membership) {
             if ($membership->role == CultureFeed_Pages_Membership::MEMBERSHIP_ROLE_ADMIN) {
                 $adminPagesCount++;
             }
         }
         $user->adminPagesCount = $adminPagesCount;
     }
     // Add following pages.
     $following = $element->xpath('/foaf:person/following/page');
     foreach ($following as $object) {
         $pageId = $object->xpath_str('uid');
         if (empty($pageId)) {
             continue;
         }
         $follower = new CultureFeed_Pages_Follower();
         $page = new CultureFeed_Cdb_Item_Page();
         $page->setId($pageId);
         $page->setName($object->xpath_str('name'));
         // Set categories
         $categories_element = $object->xpath('categoryIds/categoryId');
         $categories = array();
         foreach ($categories_element as $category) {
             $categories[] = (string) $category;
         }
         $page->setCategories($categories);
         $follower->page = $page;
         $follower->user = $user;
         $follower->creationDate = $object->xpath_time('dateCreated');
         $followers[] = $follower;
     }
     if (!empty($followers)) {
         $user->following = $followers;
     }
     return $user;
 }
 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;
 }
 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;
 }
Example #14
0
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     //dpm( print_r( $object , true ) );
     $ticket_sale = new CultureFeed_Uitpas_Event_TicketSale();
     $ticket_sale->id = $object->xpath_int('id');
     $ticket_sale->nodeId = $object->xpath_str('nodeId');
     $ticket_sale->nodeTitle = $object->xpath_str('nodeTitle');
     $ticket_sale->creationDate = $object->xpath_time('creationDate');
     $ticket_sale->createdVia = $object->xpath_str('createdVia');
     $ticket_sale->price = $object->xpath_float('price');
     $ticket_sale->tariff = $object->xpath_float('tariff');
     $ticket_sale->firstName = $object->xpath_str('firstName');
     $ticket_sale->lastName = $object->xpath_str('lastName');
     $ticket_sale->userId = $object->xpath_str('userId');
     $ticket_sale->userHomeCity = $object->xpath_str('userHomeCity');
     $ticket_sale->dateOfBirth = $object->xpath_str('dateOfBirth');
     $ticket_sale->uitpasNumber = $object->xpath_str('uitpasNumber');
     $ticket_sale->status = $object->xpath_str('status');
     $xmlTicketSaleCoupon = $object->xpath('ticketSaleCoupon', false);
     if ($xmlTicketSaleCoupon instanceof SimpleXMLElement) {
         $ticket_sale->ticketSaleCoupon = CultureFeed_Uitpas_Event_TicketSale_Coupon::createFromXML($xmlTicketSaleCoupon);
     }
     return $ticket_sale;
 }