Conditions | 6 |
Paths | 5 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function __construct(TravelSeatAvailabilityOptions $options) |
||
28 | { |
||
29 | $this->Party = new Party($options->party); |
||
30 | |||
31 | $coreRequest = new SeatAvailability\CoreRequest(); |
||
32 | |||
33 | if (($orderId = $options->orderId) && ($ownerCode = $options->ownerCode)) { |
||
34 | $coreRequest->setOrder( |
||
35 | new Order( |
||
36 | $orderId, |
||
37 | $ownerCode |
||
38 | ) |
||
39 | ); |
||
40 | } elseif (($offerItemId = $options->offerItemId) && ($ownerCode = $options->ownerCode)) { |
||
41 | $coreRequest->setOffer(new Offer($offerItemId, $ownerCode)); |
||
42 | } else { |
||
43 | throw new \InvalidArgumentException('Invalid combination of arguments at TravelSeatAvailabilityOptions'); |
||
44 | } |
||
45 | |||
46 | $this->Request = new SeatAvailability\Request($coreRequest); |
||
47 | |||
48 | if ($shoppingResponseId = $options->shoppingResponseId) { |
||
49 | $this->Request->setShoppingResponse(new ShoppingResponse($shoppingResponseId)); |
||
50 | } |
||
53 |