/**
  * @param CultureFeed_SimpleXMLElement $object
  *
  * @return self
  */
 public static function createFromXml(CultureFeed_SimpleXMLElement $object)
 {
     $instance = new static();
     $instance->cardSystem = CultureFeed_Uitpas_CardSystem::createFromXML($object->xpath('cardSystem', FALSE));
     $instance->uitpasNumber = $object->xpath_str('uitpasNumber');
     $instance->status = $object->xpath_str('status');
     $instance->type = $object->xpath_str('cardType');
     return $instance;
 }
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     $card_counter = new CultureFeed_Uitpas_Counter_CardCounter();
     $card_counter->status = $object->xpath_str('status');
     $card_counter->kansenstatuut = $object->xpath_bool('kansenstatuut');
     $card_counter->count = $object->xpath_int('count');
     $card_counter->cardSystem = CultureFeed_Uitpas_CardSystem::createFromXML($object->xpath('cardSystem', FALSE));
     return $card_counter;
 }
 public static function createFromXml(CultureFeed_SimpleXMLElement $object)
 {
     $instance = parent::createFromXML($object);
     foreach ($object->xpath('permissions/permission') as $permission) {
         $instance->permissions[] = (string) $permission;
     }
     foreach ($object->xpath('groups/group') as $group) {
         $instance->groups[] = (string) $group;
     }
     return $instance;
 }
Beispiel #4
0
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     $card = new CultureFeed_Uitpas_Passholder_Card();
     $card->city = $object->xpath_str('city');
     $card->uitpasNumber = $object->xpath_str('uitpasNumber/uitpasNumber');
     $card->kansenpas = $object->xpath_bool('kansenpas');
     $card->status = $object->xpath_str('status');
     $card->type = $object->xpath_str('cardType');
     $cardSystemXml = $object->xpath('cardSystem', false);
     if ($cardSystemXml instanceof CultureFeed_SimpleXMLElement) {
         $card->cardSystem = CultureFeed_Uitpas_CardSystem::createFromXML($cardSystemXml);
     } elseif (!is_null($object->xpath_int('cardSystemId'))) {
         $card->cardSystem = new CultureFeed_Uitpas_CardSystem();
         $card->cardSystem->id = $object->xpath_int('cardSystemId');
         $card->cardSystem->name = '';
     }
     return $card;
 }
 /**
  * @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;
 }
Beispiel #6
0
 public function getCardSystems($permanent = NULL)
 {
     if ($permanent == 'permanent') {
         $result = $this->oauth_client->consumerGetAsXml('uitpas/cardsystem?permanent=true');
     } else {
         $result = $this->oauth_client->consumerGetAsXml('uitpas/cardsystem');
     }
     try {
         $xml = new CultureFeed_SimpleXMLElement($result);
     } catch (Exception $e) {
         throw new CultureFeed_ParseException($result);
     }
     $cardsystems = array();
     foreach ($xml->cardSystems->cardSystem as $cardSystemXml) {
         $cardsystems[] = CultureFeed_Uitpas_CardSystem::createFromXML($cardSystemXml);
     }
     return $cardsystems;
 }
 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;
 }
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     $price = new CultureFeed_Uitpas_Passholder_UitpasPrice();
     $price->id = $object->xpath_str('id');
     $price->reason = $object->xpath_str('reason');
     $price->kansenStatuut = $object->xpath_bool('kansenstatuut');
     $price->price = $object->xpath_float('price');
     $price->cardType = $object->xpath_str('cardType');
     $ageRange = $object->xpath('ageRange', FALSE);
     if ($ageRange) {
         $ageFrom = $ageRange->xpath_int('ageFrom', FALSE);
         if ($ageFrom) {
             $price->ageRange->ageFrom = $ageFrom;
         }
         $ageTo = $ageRange->xpath_int('ageTo', FALSE);
         if ($ageTo) {
             $price->ageRange->ageTo = $ageTo;
         }
     }
     $voucherType = $object->xpath('voucherType', FALSE);
     if ($voucherType) {
         $price->voucherType = new CultureFeed_Uitpas_Passholder_VoucherType();
         $name = $voucherType->xpath_str('name', FALSE);
         if ($name) {
             $price->voucherType->name = $name;
         }
         $prefix = $voucherType->xpath_str('prefix', FALSE);
         if ($prefix) {
             $price->voucherType->prefix = $prefix;
         }
     }
     $price->cardSystem = CultureFeed_Uitpas_CardSystem::createFromXML($object->xpath('cardSystem', FALSE));
     return $price;
 }