function __construct($input = [], $flags = 0, $iterator_class = Shipwire::ITERATOR)
 {
     $input['length'] = $input['length'] ? intval($input['length']) : 0;
     $input['width'] = $input['width'] ? intval($input['width']) : 0;
     $input['height'] = $input['height'] ? intval($input['height']) : 0;
     $input['length'] = $input['length'] ? intval($input['length']) : 0;
     parent::__construct($input, $flags, $iterator_class);
 }
 function __construct($input = [], $flags = 0, $iterator_class = Shipwire::ITERATOR)
 {
     $input['trackedDate'] = $input['trackedDate'] ? new \DateTime($input['trackedDate']) : null;
     $input['deliveredDate'] = $input['deliveredDate'] ? new \DateTime($input['deliveredDate']) : null;
     $input['createdDate'] = $input['createdDate'] ? new \DateTime($input['createdDate']) : null;
     $input['summaryDate'] = $input['summaryDate'] ? new \DateTime($input['summaryDate']) : null;
     parent::__construct($input, $flags, $iterator_class);
 }
Ejemplo n.º 3
0
 function __construct($input = [], $flags = 0, $iterator_class = Shipwire::ITERATOR)
 {
     $replace_items = [];
     foreach ($input['shipments'] as $shipment) {
         $replace_items[] = new ShipwireRateShipment($shipment);
     }
     $input['shipments'] = new ShipwireItems($replace_items);
     parent::__construct($input, $flags, $iterator_class);
 }
 function __construct($input = [], $flags = 0, $iterator_class = Shipwire::ITERATOR)
 {
     $input['costValue'] = $input['costValue'] ? intval($input['costValue']) : 0;
     $input['wholesaleValue'] = $input['wholesaleValue'] ? intval($input['wholesaleValue']) : 0;
     $input['retailValue'] = $input['retailValue'] ? intval($input['retailValue']) : 0;
     $input['costCurrency'] = $input['costCurrency'] ? strval($input['costCurrency']) : Shipwire::DefaultCurrency;
     $input['wholesaleCurrency'] = $input['wholesaleCurrency'] ? strval($input['wholesaleCurrency']) : Shipwire::DefaultCurrency;
     $input['retailCurrency'] = $input['retailCurrency'] ? strval($input['retailCurrency']) : Shipwire::DefaultCurrency;
     parent::__construct($input, $flags, $iterator_class);
 }
 function __construct($input = [], $flags = 0, $iterator_class = Shipwire::ITERATOR)
 {
     $input['sku'] = $input['sku'] ? strval($input['sku']) : null;
     $input['externalId'] = $input['externalId'] ? strval($input['externalId']) : null;
     $input['countryOfOrigin'] = $input['countryOfOrigin'] ?: 'US';
     $input['category'] = $input['category'] ?: 'OTHER';
     $input['batteryConfiguration'] = $input['batteryConfiguration'] ?: 'NOBATTERY';
     $input['classification'] = $input['classification'] ?: self::DEFAULT_PRODUCT_CLASS;
     $input['creationDate'] = $input['creationDate'] ? new \DateTime($input['creationDate']) : null;
     parent::__construct($input, $flags, $iterator_class);
 }
 function __construct($input = [], $flags = 0, $iterator_class = Shipwire::ITERATOR)
 {
     $input['createdDate'] = $input['createdDate'] ? new \DateTime($input['createdDate']) : null;
     $input['pickedUpDate'] = $input['pickedUpDate'] ? new \DateTime($input['pickedUpDate']) : null;
     $input['submittedDate'] = $input['submittedDate'] ? new \DateTime($input['submittedDate']) : null;
     $input['processedDate'] = $input['processedDate'] ? new \DateTime($input['processedDate']) : null;
     $input['completedDate'] = $input['completedDate'] ? new \DateTime($input['completedDate']) : null;
     $input['expectedDate'] = $input['expectedDate'] ? new \DateTime($input['expectedDate']) : null;
     $input['cancelledDate'] = $input['cancelledDate'] ? new \DateTime($input['cancelledDate']) : null;
     $input['returnedDate'] = $input['returnedDate'] ? new \DateTime($input['returnedDate']) : null;
     $input['lastManualUpdateDate'] = $input['lastManualUpdateDate'] ? new \DateTime($input['lastManualUpdateDate']) : null;
     parent::__construct($input, $flags, $iterator_class);
 }
 function __construct($input = [], $flags = 0, $iterator_class = Shipwire::ITERATOR)
 {
     $input['isPackagedReadyToShip'] = $input['length'] ? intval($input['length']) : 0;
     $input['isFragile'] = $input['width'] ? intval($input['width']) : 0;
     $input['isDangerous'] = $input['height'] ? intval($input['height']) : 0;
     $input['isPerishable'] = $input['length'] ? intval($input['length']) : 0;
     $input['isMedia'] = $input['length'] ? intval($input['length']) : 0;
     $input['isAdult'] = $input['length'] ? intval($input['length']) : 0;
     $input['isLiquid'] = $input['length'] ? intval($input['length']) : 0;
     $input['hasInnerPack'] = $input['length'] ? intval($input['length']) : 0;
     $input['hasMasterCase'] = $input['length'] ? intval($input['length']) : 0;
     $input['hasPallet'] = $input['length'] ? intval($input['length']) : 0;
     parent::__construct($input, $flags, $iterator_class);
 }
 function __construct($input = [], $flags = 0, $iterator_class = Shipwire::ITERATOR)
 {
     $input['expectedShipDate'] = $input['expectedShipDate'] ? new \DateTime($input['expectedShipDate']) : null;
     $input['expectedDeliveryMinDate'] = $input['expectedDeliveryMinDate'] ? new \DateTime($input['expectedDeliveryMinDate']) : null;
     $input['expectedDeliveryMaxDate'] = $input['expectedDeliveryMaxDate'] ? new \DateTime($input['expectedDeliveryMaxDate']) : null;
     $input['carrier'] = $input['carrier'] ? new ShipwireCarrier($input['carrier']) : null;
     $input['cost'] = $input['cost'] ? new ShipwireMoney($input['cost']) : null;
     $replace_items = [];
     foreach ($input['subtotals'] as $monies) {
         $replace_items[] = new ShipwireMoney($monies);
     }
     $input['subtotals'] = new ShipwireItems($replace_items);
     $replace_items = [];
     foreach ($input['pieces'] as $piece) {
         $replace_items[] = new ShipwireRateDimensions($piece);
     }
     $input['pieces'] = new ShipwireItems($replace_items);
     parent::__construct($input, $flags, $iterator_class);
 }
 function __construct($input = [], $flags = 0, $iterator_class = Shipwire::ITERATOR)
 {
     $input['processAfterDate'] = $input['processAfterDate'] ? new \DateTime($input['processAfterDate']) : null;
     $input['lastUpdatedDate'] = $input['lastUpdatedDate'] ? new \DateTime($input['lastUpdatedDate']) : null;
     $input['shipTo'] = $input['shipTo']['resource'] ? new ShipwireAddress($input['shipTo']['resource']) : null;
     $input['shipFrom'] = $input['shipFrom']['resource'] ? new ShipwireAddress($input['shipFrom']['resource']) : null;
     $input['routing'] = $input['routing']['resource'] ? new ShipwireOrderRouting($input['routing']['resource']) : null;
     $input['options'] = $input['options']['resource'] ? new ShipwireOptions($input['options']['resource']) : null;
     $input['events'] = $input['events']['resource'] ? new ShipwireOrderEvents($input['events']['resource']) : null;
     $input['pricing'] = $input['pricing']['resource'] ? new ShipwireOrderPricing($input['pricing']['resource']) : null;
     $input['pricingEstimate'] = $input['pricingEstimate']['resource'] ? new ShipwireOrderPricing($input['pricingEstimate']['resource']) : null;
     $replace_items = [];
     foreach ($input['items']['resource']['items'] as $order_item) {
         $replace_items[] = new ShipwireOrderItem($order_item['resource']);
     }
     $input['items'] = new ShipwireItems($replace_items);
     $replace_items = [];
     foreach ($input['trackings']['resource']['items'] as $order_item) {
         $replace_items[] = new ShipwireTracking($order_item['resource']);
     }
     $input['trackings'] = new ShipwireItems($replace_items);
     parent::__construct($input, $flags, $iterator_class);
 }
 function __construct($input = [], $flags = 0, $iterator_class = Shipwire::ITERATOR)
 {
     parent::__construct($input, $flags, $iterator_class);
 }
Ejemplo n.º 11
0
 function __construct($input = [], $flags = 0, $iterator_class = Shipwire::ITERATOR)
 {
     $input['properties'] = $input['properties'] ? new ShipwireOptions($input['properties']) : null;
     parent::__construct($input, $flags, $iterator_class);
 }