Conditions | 8 |
Paths | 5 |
Total Lines | 37 |
Code Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function __construct(TravelServiceListOptions $options) |
||
30 | { |
||
31 | $this->Party = new Party($options->party); |
||
32 | |||
33 | $coreRequest = new ServiceList\CoreRequest(); |
||
34 | |||
35 | if (($orderId = $options->orderId) && ($ownerCode = $options->ownerCode)) { |
||
36 | $coreRequest->setOrder( |
||
37 | new Order( |
||
38 | $orderId, |
||
39 | $ownerCode |
||
40 | ) |
||
41 | ); |
||
42 | } elseif (($offerId = $options->offerId) |
||
43 | && ($offerItemId = $options->offerItemId) |
||
44 | && ($ownerCode = $options->ownerCode) |
||
45 | && ($serviceId = $options->serviceId) |
||
46 | ) { |
||
47 | $coreRequest->setOffer( |
||
48 | new Offer( |
||
49 | $offerId, |
||
50 | $ownerCode, |
||
51 | new OfferItem( |
||
52 | $offerItemId, |
||
53 | $ownerCode, |
||
54 | new Service($serviceId) |
||
55 | ) |
||
56 | ) |
||
57 | ); |
||
58 | } else { |
||
59 | throw new \InvalidArgumentException('Invalid combination of arguments at TravelServiceListOptions'); |
||
60 | } |
||
61 | |||
62 | $this->Request = new ServiceList\Request($coreRequest); |
||
63 | |||
64 | if ($shoppingResponseId = $options->shoppingResponseId) { |
||
65 | $this->Request->setShoppingResponse(new ShoppingResponse($shoppingResponseId)); |
||
66 | } |
||
69 |