/**
  * @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;
 }