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; }
public static function createFromXML(CultureFeed_SimpleXMLElement $object) { $counter = new CultureFeed_Uitpas_Passholder_Counter(); $counter->id = $object->xpath_str('id'); $counter->name = $object->xpath_str('name'); return $counter; }
public static function createFromXML(CultureFeed_SimpleXMLElement $object) { $response = new CultureFeed_Uitpas_Response(); $response->code = $object->xpath_str('code'); $response->message = $object->xpath_str('message'); return $response; }
public static function createFromXML(CultureFeed_SimpleXMLElement $object) { $condition = new self(); $condition->definition = $object->xpath_str('definition'); $condition->operator = $object->xpath_str('operator'); $condition->value = $object->xpath_str('value'); return $condition; }
/** * @param CultureFeed_SimpleXMLElement $xml * @return CultureFeed_Uitpas_Passholder_EventBuyTicket */ public static function createFromXml(CultureFeed_SimpleXMLElement $xml) { $buyTicket = new self(); $buyTicket->tariff = $xml->xpath_float('tariff'); $buyTicket->price = $xml->xpath_float('price'); $buyTicket->cdbid = $xml->xpath_str('cdbid'); $buyTicket->buyConstraintReason = $xml->xpath_str('buyConstraintReason'); return $buyTicket; }
public static function createFromXML(CultureFeed_SimpleXMLElement $object) { $member = new CultureFeed_Uitpas_Counter_Member(); $object->registerXPathNamespace('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns'); $object->registerXPathNamespace('foaf', 'http://xmlns.com/foaf/0.1/'); $member->id = $object->xpath_str('rdf:id'); $member->nick = $object->xpath_str('foaf:nick'); return $member; }
/** * @param CultureFeed_SimpleXMLElement $xml * @return CultureFeed_Uitpas_Passholder_EventCheckin */ public static function createFromXml(CultureFeed_SimpleXMLElement $xml) { $eventCheckin = new self(); $eventCheckin->checkinAllowed = $xml->xpath_bool('checkinAllowed'); $eventCheckin->numberOfPoints = $xml->xpath_int('numberOfPoints'); $eventCheckin->cdbid = $xml->xpath_str('cdbid'); $eventCheckin->checkinConstraintReason = $xml->xpath_str('checkinConstraintReason'); return $eventCheckin; }
public static function createFromXML(CultureFeed_SimpleXMLElement $xml) { $response = new self(); $response->code = $xml->xpath_str('code'); $response->price = $xml->xpath_float('price'); $response->id = $xml->xpath_str('id'); $response->tariff = $xml->xpath_float('tariff'); return $response; }
/** * @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) { $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; }
/** * @param CultureFeed_SimpleXMLElement $xml * @return CultureFeed_Uitpas_Passholder_ExecuteEventActionsResult_PointsPromotionsResponse */ public static function createFromXML(CultureFeed_SimpleXMLElement $xml) { $response = new self(); $response->code = $xml->xpath_str('code'); $response->promotion = CultureFeed_Uitpas_Passholder_PointsPromotion::createFromXML($xml->xpath('promotion', false)); if ($response->code === 'ACTION_NOT_ALLOWED') { $response->cashInState = $xml->xpath_str('cashInState'); } return $response; }
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; }
public static function createFromXML(CultureFeed_SimpleXMLElement $object) { $device = new CultureFeed_Uitpas_Counter_Device(); $device->name = $object->xpath_str('name'); $device->consumerKey = $object->xpath_str('consumerKey'); $device->status = $object->xpath_str('status'); $device->cdbid = $object->xpath_str('cdbid'); foreach ($object->xpath('balies/balie') as $balie) { $device->counters[] = CultureFeed_Uitpas_Counter::createFromXml($balie); } return $device; }
/** * Validate the request result. * * @param string $result * Result from the request. * @param string $valid_status_code * Status code if this is a valid request. * @param string $status_xml_tag * Xml tag where the status code can be checked. * @return CultureFeed_SimpleXMLElement The parsed xml. * * @throws CultureFeed_ParseException * If the result could not be parsed. * @throws CultureFeed_InvalidCodeException * If no valid result status code. */ protected function validateResult($result, $valid_status_code, $status_xml_tag = 'code') { try { $xml = new CultureFeed_SimpleXMLElement($result); } catch (Exception $e) { throw new CultureFeed_ParseException($result); } $status_code = $xml->xpath_str($status_xml_tag); if ($status_code == $valid_status_code) { return $xml; } throw new CultureFeed_InvalidCodeException($xml->xpath_str('message'), $status_code); }
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) { $counter = new CultureFeed_Uitpas_Counter_Employee(); $counter->id = $object->xpath_str('id'); $counter->consumerKey = $object->xpath_str('consumerKey'); $counter->name = $object->xpath_str('name'); $counter->role = $object->xpath_str('role'); $counter->actorId = $object->xpath_str('actorId'); foreach ($object->xpath('cardSystems/cardSystem') as $card_system) { $cardSystem = CultureFeed_Uitpas_Counter_EmployeeCardSystem::createFromXml($card_system); $counter->cardSystems[$cardSystem->id] = $cardSystem; } return $counter; }
/** * @param string $code. * @param CultureFeed_SimpleXMLElement $xml * * @return self */ public static function createFromXML($code, $xml) { $message = $xml->xpath_str('/response/message'); $exception = new static($message, $code); if ($code == 'INSZ_ALREADY_USED') { $exception->cardSystemLinks = array(); foreach ($xml->xpath('cardSystemLinks/cardSystemLink') as $cardSystemLink) { $cardSystemId = $cardSystemLink->xpath_int('cardSystem/id', FALSE); $exception->cardSystemLinks[$cardSystemId] = CultureFeed_Uitpas_CardInfo::createFromXml($cardSystemLink, FALSE); } $exception->userId = $xml->xpath_str('/response/userId'); } return $exception; }
/** * @param CultureFeed_SimpleXMLElement $object * @return CultureFeed_Uitpas_PeriodConstraint */ public static function createFromXml(CultureFeed_SimpleXMLElement $object) { $periodConstraint = new CultureFeed_Uitpas_PeriodConstraint(); $periodConstraint->type = $object->xpath_str('periodType', FALSE); $periodConstraint->volume = $object->xpath_int('periodVolume', FALSE); return $periodConstraint; }
public static function createFromXML(CultureFeed_SimpleXMLElement $xml) { $response = new self(); $response->code = $xml->xpath_str('code'); $response->points = $xml->xpath_int('points'); return $response; }
/** * @param CultureFeed_SimpleXMLElement $object * @return CultureFeed_Uitpas_Event_TicketSale_Opportunity */ public static function createFromXml(CultureFeed_SimpleXMLElement $object) { $opportunity = new CultureFeed_Uitpas_Event_TicketSale_Opportunity(); $opportunity->type = CultureFeed_Uitpas_Event_TicketSale_Opportunity::TYPE_DEFAULT; if (isset($object['type'])) { $opportunity->type = (string) $object['type']; } $opportunity->buyConstraintReason = $object->xpath_str('buyConstraintReason', FALSE); foreach ($object->xpath('priceClasses/priceClass') as $priceClass) { $opportunity->priceClasses[] = CultureFeed_Uitpas_Event_PriceClass::createFromXml($priceClass); } $couponElement = $object->xpath('ticketSaleCoupon', FALSE); if ($couponElement instanceof CultureFeed_SimpleXMLElement) { $opportunity->ticketSaleCoupon = CultureFeed_Uitpas_Event_TicketSale_Coupon::createFromXml($couponElement); } $remainingForEventElement = $object->xpath('remainingForEvent', FALSE); if ($remainingForEventElement instanceof CultureFeed_SimpleXMLElement) { $opportunity->remainingForEvent = CultureFeed_Uitpas_PeriodConstraint::createFromXml($remainingForEventElement); } $remainingTotalElement = $object->xpath('remainingTotal', FALSE); if ($remainingTotalElement instanceof CultureFeed_SimpleXMLElement) { $opportunity->remainingTotal = CultureFeed_Uitpas_PeriodConstraint::createFromXml($remainingTotalElement); } return $opportunity; }
/** * @param CultureFeed_SimpleXMLElement $xml * @return CultureFeed_Uitpas_Passholder_ExecuteEventActionsResult_WelcomeAdvantageResponse */ public static function createFromXML(CultureFeed_SimpleXMLElement $xml) { $response = new self(); $response->code = $xml->xpath_str('code'); $response->promotion = CultureFeed_Uitpas_Passholder_WelcomeAdvantage::createFromXML($xml->xpath('promotion', false)); return $response; }
public static function createFromXML(CultureFeed_SimpleXMLElement $object) { $constraint = new CultureFeed_Uitpas_Passholder_PeriodConstraint(); $constraint->periodVolume = $object->xpath_int('periodVolume'); $constraint->periodType = $object->xpath_str('periodType'); return $constraint; }
/** * @param CultureFeed_SimpleXMLElement $object * @return CultureFeed_Uitpas_GroupPass */ public static function createFromXML(CultureFeed_SimpleXMLElement $object) { $pass = new self(); $pass->name = $object->xpath_str('name'); $pass->availableTickets = $object->xpath_int('availableTickets'); return $pass; }
/** * @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; }
public static function createFromXML(CultureFeed_SimpleXMLElement $object) { $distribution_key = new CultureFeed_Uitpas_DistributionKey(); $distribution_key->id = $object->xpath_int('id'); $distribution_key->name = $object->xpath_str('name'); $distribution_key->conditions = array(); foreach ($object->xpath('conditions/condition') as $condition) { $distribution_key->conditions[] = CultureFeed_Uitpas_DistributionKey_Condition::createFromXML($condition, FALSE); } foreach ($object->xpath('priceClasses/priceClass') as $priceClass) { $distribution_key->priceClasses[] = CultureFeed_Uitpas_Event_PriceClass::createFromXML($priceClass); } $distribution_key->tariff = $object->xpath_str('tariff'); $distribution_key->automatic = $object->xpath_bool('automatic'); $distribution_key->sameRegion = $object->xpath_bool('sameRegion'); return $distribution_key; }
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; }
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; }
/** * @param CultureFeed_SimpleXMLElement $object * * @return CultureFeed_Uitpas_CardSystem */ public static function createFromXML(CultureFeed_SimpleXMLElement $object) { $card_system = new static(); $card_system->id = $object->xpath_int('id'); $card_system->name = $object->xpath_str('name'); $card_system->distributionKeys = array(); foreach ($object->xpath('distributionKeys/distributionKey') as $distributionKey) { $card_system->distributionKeys[] = CultureFeed_Uitpas_DistributionKey::createFromXML($distributionKey, FALSE); } return $card_system; }
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; }
/** * @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; }