Complex classes like Client often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Client, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
40 | class Client extends Base |
||
41 | { |
||
42 | /** |
||
43 | * Amadeus SOAP header version 1 |
||
44 | */ |
||
45 | const HEADER_V1 = "1"; |
||
46 | /** |
||
47 | * Amadeus SOAP header version 2 |
||
48 | */ |
||
49 | const HEADER_V2 = "2"; |
||
50 | /** |
||
51 | * Amadeus SOAP header version 4 |
||
52 | */ |
||
53 | const HEADER_V4 = "4"; |
||
54 | |||
55 | /** |
||
56 | * Version string |
||
57 | * |
||
58 | * @var string |
||
59 | */ |
||
60 | const VERSION = "1.5.0-dev"; |
||
61 | |||
62 | /** |
||
63 | * An identifier string for the library (to be used in Received From entries) |
||
64 | * |
||
65 | * @var string |
||
66 | */ |
||
67 | const RECEIVED_FROM_IDENTIFIER = "amabnl-amadeus-ws-client"; |
||
68 | |||
69 | /** |
||
70 | * @var string |
||
71 | */ |
||
72 | protected $lastMessage; |
||
73 | |||
74 | /** |
||
75 | * Set the session as stateful (true) or stateless (false) |
||
76 | * |
||
77 | * @param bool $newStateful |
||
78 | */ |
||
79 | 1 | public function setStateful($newStateful) |
|
83 | |||
84 | /** |
||
85 | * @return bool |
||
86 | */ |
||
87 | 3 | public function isStateful() |
|
91 | |||
92 | /** |
||
93 | * Get the last raw XML message that was sent out |
||
94 | * |
||
95 | * @return string|null |
||
96 | */ |
||
97 | 1 | public function getLastRequest() |
|
101 | |||
102 | /** |
||
103 | * Get the last raw XML message that was received |
||
104 | * |
||
105 | * @return string|null |
||
106 | */ |
||
107 | 1 | public function getLastResponse() |
|
111 | |||
112 | /** |
||
113 | * Get the request headers for the last SOAP message that was sent out |
||
114 | * |
||
115 | * @return string|null |
||
116 | */ |
||
117 | 1 | public function getLastRequestHeaders() |
|
121 | |||
122 | /** |
||
123 | * Get the response headers for the last SOAP message that was received |
||
124 | * |
||
125 | * @return string|null |
||
126 | */ |
||
127 | 1 | public function getLastResponseHeaders() |
|
131 | |||
132 | /** |
||
133 | * Get session information for authenticated session |
||
134 | * |
||
135 | * - sessionId |
||
136 | * - sequenceNr |
||
137 | * - securityToken |
||
138 | * |
||
139 | * @return array|null |
||
140 | */ |
||
141 | 1 | public function getSessionData() |
|
145 | |||
146 | /** |
||
147 | * Restore a previously used session |
||
148 | * |
||
149 | * To be used when implementing your own session pooling system on legacy Soap Header 2 applications. |
||
150 | * |
||
151 | * @param array $sessionData |
||
152 | * @return bool |
||
153 | */ |
||
154 | 1 | public function setSessionData(array $sessionData) |
|
158 | |||
159 | /** |
||
160 | * Construct Amadeus Web Services client |
||
161 | * |
||
162 | * @param Params $params |
||
163 | */ |
||
164 | 83 | public function __construct(Params $params) |
|
172 | |||
173 | /** |
||
174 | * Authenticate. |
||
175 | * |
||
176 | * Authentication Parameters were provided at construction time (authParams) |
||
177 | * |
||
178 | * @return Result |
||
179 | * @throws Exception |
||
180 | */ |
||
181 | 2 | public function securityAuthenticate() |
|
194 | |||
195 | /** |
||
196 | * Terminate a session - only applicable to non-stateless mode. |
||
197 | * |
||
198 | * @return Result |
||
199 | * @throws Exception |
||
200 | */ |
||
201 | 1 | public function securitySignOut() |
|
212 | |||
213 | /** |
||
214 | * PNR_Retrieve - Retrieve an Amadeus PNR by record locator |
||
215 | * |
||
216 | * @param RequestOptions\PnrRetrieveOptions $options |
||
217 | * @param array $messageOptions (OPTIONAL) |
||
218 | * @return Result |
||
219 | * @throws Exception |
||
220 | */ |
||
221 | 1 | public function pnrRetrieve(RequestOptions\PnrRetrieveOptions $options, $messageOptions = []) |
|
227 | |||
228 | /** |
||
229 | * Create a PNR using PNR_AddMultiElements |
||
230 | * |
||
231 | * @param RequestOptions\PnrCreatePnrOptions $options |
||
232 | * @param array $messageOptions (OPTIONAL) |
||
233 | * @return Result |
||
234 | */ |
||
235 | 1 | public function pnrCreatePnr(RequestOptions\PnrCreatePnrOptions $options, $messageOptions = []) |
|
241 | |||
242 | /** |
||
243 | * PNR_AddMultiElements - Create a new PNR or update an existing PNR. |
||
244 | * |
||
245 | * https://webservices.amadeus.com/extranet/viewService.do?id=25&flavourId=1&menuId=functional |
||
246 | * |
||
247 | * @param RequestOptions\PnrAddMultiElementsOptions $options |
||
248 | * @param array $messageOptions (OPTIONAL) |
||
249 | * @return Result |
||
250 | */ |
||
251 | 2 | public function pnrAddMultiElements(RequestOptions\PnrAddMultiElementsOptions $options, $messageOptions = []) |
|
257 | |||
258 | /** |
||
259 | * PNR_RetrieveAndDisplay - Retrieve an Amadeus PNR by record locator including extra info |
||
260 | * |
||
261 | * This extra info is info you cannot see in the regular PNR, like Offers. |
||
262 | * |
||
263 | * https://webservices.amadeus.com/extranet/viewService.do?id=1922&flavourId=1&menuId=functional |
||
264 | * |
||
265 | * @param RequestOptions\PnrRetrieveAndDisplayOptions $options Amadeus Record Locator for PNR |
||
266 | * @param array $messageOptions (OPTIONAL) |
||
267 | * @return Result |
||
268 | * @throws Exception |
||
269 | **/ |
||
270 | 1 | public function pnrRetrieveAndDisplay(RequestOptions\PnrRetrieveAndDisplayOptions $options, $messageOptions = []) |
|
276 | |||
277 | /** |
||
278 | * PNR_Cancel |
||
279 | * |
||
280 | * @param RequestOptions\PnrCancelOptions $options |
||
281 | * @param array $messageOptions (OPTIONAL) |
||
282 | * @return Result |
||
283 | */ |
||
284 | 1 | public function pnrCancel(RequestOptions\PnrCancelOptions $options, $messageOptions = []) |
|
290 | |||
291 | /** |
||
292 | * PNR_DisplayHistory |
||
293 | * |
||
294 | * @param RequestOptions\PnrDisplayHistoryOptions $options |
||
295 | * @param array $messageOptions (OPTIONAL) |
||
296 | * @return Result |
||
297 | */ |
||
298 | 1 | public function pnrDisplayHistory(RequestOptions\PnrDisplayHistoryOptions $options, $messageOptions = []) |
|
304 | |||
305 | /** |
||
306 | * PNR_TransferOwnership |
||
307 | * |
||
308 | * @param RequestOptions\PnrTransferOwnershipOptions $options |
||
309 | * @param array $messageOptions (OPTIONAL) |
||
310 | * @return Result |
||
311 | */ |
||
312 | 1 | public function pnrTransferOwnership(RequestOptions\PnrTransferOwnershipOptions $options, $messageOptions = []) |
|
318 | |||
319 | /** |
||
320 | * PNR_NameChange |
||
321 | * |
||
322 | * @param RequestOptions\PnrNameChangeOptions $options |
||
323 | * @param array $messageOptions (OPTIONAL) |
||
324 | * @return Result |
||
325 | */ |
||
326 | 1 | public function pnrNameChange(RequestOptions\PnrNameChangeOptions $options, $messageOptions = []) |
|
332 | |||
333 | /** |
||
334 | * Queue_List - get a list of all PNR's on a given queue |
||
335 | * |
||
336 | * https://webservices.amadeus.com/extranet/viewService.do?id=52&flavourId=1&menuId=functional |
||
337 | * |
||
338 | * @param RequestOptions\QueueListOptions $options |
||
339 | * @param array $messageOptions (OPTIONAL) |
||
340 | * @return Result |
||
341 | */ |
||
342 | 1 | public function queueList(RequestOptions\QueueListOptions $options, $messageOptions = []) |
|
348 | |||
349 | /** |
||
350 | * Queue_PlacePNR - Place a PNR on a given queue |
||
351 | * |
||
352 | * @param RequestOptions\QueuePlacePnrOptions $options |
||
353 | * @param array $messageOptions (OPTIONAL) |
||
354 | * @return Result |
||
355 | */ |
||
356 | 1 | public function queuePlacePnr(RequestOptions\QueuePlacePnrOptions $options, $messageOptions = []) |
|
362 | |||
363 | /** |
||
364 | * Queue_RemoveItem - remove an item (a PNR) from a given queue |
||
365 | * |
||
366 | * @param RequestOptions\QueueRemoveItemOptions $options |
||
367 | * @param array $messageOptions (OPTIONAL) |
||
368 | * @return Result |
||
369 | */ |
||
370 | 1 | public function queueRemoveItem(RequestOptions\QueueRemoveItemOptions $options, $messageOptions = []) |
|
376 | |||
377 | /** |
||
378 | * Queue_MoveItem - move an item (a PNR) from one queue to another. |
||
379 | * |
||
380 | * @param RequestOptions\QueueMoveItemOptions $options |
||
381 | * @param array $messageOptions (OPTIONAL) |
||
382 | * @return Result |
||
383 | */ |
||
384 | 1 | public function queueMoveItem(RequestOptions\QueueMoveItemOptions $options, $messageOptions = []) |
|
390 | |||
391 | /** |
||
392 | * Offer_CreateOffer |
||
393 | * |
||
394 | * @param RequestOptions\OfferCreateOptions $options |
||
395 | * @param array $messageOptions (OPTIONAL) |
||
396 | * @return Result |
||
397 | */ |
||
398 | 1 | public function offerCreate(RequestOptions\OfferCreateOptions $options, $messageOptions = []) |
|
404 | |||
405 | /** |
||
406 | * Offer_VerifyOffer |
||
407 | * |
||
408 | * To be called in the context of an open PNR |
||
409 | * |
||
410 | * @param RequestOptions\OfferVerifyOptions $options |
||
411 | * @param array $messageOptions (OPTIONAL) |
||
412 | * @return Result |
||
413 | */ |
||
414 | 1 | public function offerVerify(RequestOptions\OfferVerifyOptions $options, $messageOptions = []) |
|
420 | |||
421 | /** |
||
422 | * Offer_ConfirmAirOffer |
||
423 | * |
||
424 | * @param RequestOptions\OfferConfirmAirOptions $options |
||
425 | * @param array $messageOptions (OPTIONAL) |
||
426 | * @return Result |
||
427 | */ |
||
428 | 1 | public function offerConfirmAir(RequestOptions\OfferConfirmAirOptions $options, $messageOptions = []) |
|
434 | |||
435 | /** |
||
436 | * Offer_ConfirmHotelOffer |
||
437 | * |
||
438 | * @param RequestOptions\OfferConfirmHotelOptions $options |
||
439 | * @param array $messageOptions (OPTIONAL) |
||
440 | * @return Result |
||
441 | */ |
||
442 | 1 | public function offerConfirmHotel(RequestOptions\OfferConfirmHotelOptions $options, $messageOptions = []) |
|
448 | |||
449 | /** |
||
450 | * Offer_ConfirmCarOffer |
||
451 | * |
||
452 | * @param RequestOptions\OfferConfirmCarOptions $options |
||
453 | * @param array $messageOptions (OPTIONAL) |
||
454 | * @return Result |
||
455 | */ |
||
456 | 1 | public function offerConfirmCar(RequestOptions\OfferConfirmCarOptions $options, $messageOptions = []) |
|
462 | |||
463 | /** |
||
464 | * Fare_MasterPricerTravelBoardSearch |
||
465 | * |
||
466 | * @param RequestOptions\FareMasterPricerTbSearch $options |
||
467 | * @param array $messageOptions (OPTIONAL) |
||
468 | * @return Result |
||
469 | */ |
||
470 | 1 | public function fareMasterPricerTravelBoardSearch( |
|
478 | |||
479 | /** |
||
480 | * Fare_MasterPricerCalendar |
||
481 | * |
||
482 | * @param RequestOptions\FareMasterPricerCalendarOptions $options |
||
483 | * @param array $messageOptions (OPTIONAL) |
||
484 | * @return Result |
||
485 | */ |
||
486 | 1 | public function fareMasterPricerCalendar( |
|
494 | |||
495 | /** |
||
496 | * Fare_PricePnrWithBookingClass |
||
497 | * |
||
498 | * @param RequestOptions\FarePricePnrWithBookingClassOptions $options |
||
499 | * @param array $messageOptions (OPTIONAL) |
||
500 | * @return Result |
||
501 | */ |
||
502 | 2 | public function farePricePnrWithBookingClass( |
|
510 | |||
511 | /** |
||
512 | * Fare_PricePnrWithLowerFares |
||
513 | * |
||
514 | * @param RequestOptions\FarePricePnrWithLowerFaresOptions $options |
||
515 | * @param array $messageOptions (OPTIONAL) |
||
516 | * @return Result |
||
517 | */ |
||
518 | 2 | public function farePricePnrWithLowerFares( |
|
526 | |||
527 | /** |
||
528 | * Fare_PricePnrWithLowestFare |
||
529 | * |
||
530 | * @param RequestOptions\FarePricePnrWithLowestFareOptions $options |
||
531 | * @param array $messageOptions (OPTIONAL) |
||
532 | * @return Result |
||
533 | */ |
||
534 | 2 | public function farePricePnrWithLowestFare( |
|
542 | |||
543 | /** |
||
544 | * Fare_InformativePricingWithoutPNR |
||
545 | * |
||
546 | * @param RequestOptions\FareInformativePricingWithoutPnrOptions $options |
||
547 | * @param array $messageOptions (OPTIONAL) |
||
548 | * @return Result |
||
549 | */ |
||
550 | 1 | public function fareInformativePricingWithoutPnr( |
|
558 | |||
559 | /** |
||
560 | * Fare_InformativeBestPricingWithoutPNR |
||
561 | * |
||
562 | * @param RequestOptions\FareInformativeBestPricingWithoutPnrOptions $options |
||
563 | * @param array $messageOptions (OPTIONAL) |
||
564 | * @return Result |
||
565 | */ |
||
566 | 1 | public function fareInformativeBestPricingWithoutPnr( |
|
574 | |||
575 | /** |
||
576 | * Fare_CheckRules |
||
577 | * |
||
578 | * @param RequestOptions\FareCheckRulesOptions $options |
||
579 | * @param array $messageOptions (OPTIONAL) |
||
580 | * @return Result |
||
581 | */ |
||
582 | 1 | public function fareCheckRules(RequestOptions\FareCheckRulesOptions $options, $messageOptions = []) |
|
588 | |||
589 | /** |
||
590 | * Fare_GetFareRules |
||
591 | * |
||
592 | * @param RequestOptions\FareGetFareRulesOptions $options |
||
593 | * @param array $messageOptions (OPTIONAL) |
||
594 | * @return Result |
||
595 | */ |
||
596 | 1 | public function fareGetFareRules(RequestOptions\FareGetFareRulesOptions $options, $messageOptions = []) |
|
602 | |||
603 | /** |
||
604 | * Fare_ConvertCurrency |
||
605 | * |
||
606 | * @param RequestOptions\FareConvertCurrencyOptions $options |
||
607 | * @param array $messageOptions (OPTIONAL) |
||
608 | * @return Result |
||
609 | */ |
||
610 | 1 | public function fareConvertCurrency(RequestOptions\FareConvertCurrencyOptions $options, $messageOptions = []) |
|
611 | { |
||
612 | 1 | $msgName = 'Fare_ConvertCurrency'; |
|
613 | |||
614 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
615 | } |
||
616 | |||
617 | /** |
||
618 | * Air_MultiAvailability |
||
619 | * |
||
620 | * @param RequestOptions\AirMultiAvailabilityOptions $options |
||
621 | * @param array $messageOptions (OPTIONAL) |
||
622 | * @return Result |
||
623 | */ |
||
624 | 1 | public function airMultiAvailability( |
|
625 | RequestOptions\AirMultiAvailabilityOptions $options, |
||
626 | $messageOptions = [] |
||
627 | ) { |
||
628 | 1 | $msgName = 'Air_MultiAvailability'; |
|
629 | |||
630 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
631 | } |
||
632 | |||
633 | /** |
||
634 | * Air_SellFromRecommendation |
||
635 | * |
||
636 | * @param RequestOptions\AirSellFromRecommendationOptions $options |
||
637 | * @param array $messageOptions (OPTIONAL) |
||
638 | * @return Result |
||
639 | */ |
||
640 | 1 | public function airSellFromRecommendation( |
|
648 | |||
649 | /** |
||
650 | * Air_FlightInfo |
||
651 | * |
||
652 | * @param RequestOptions\AirFlightInfoOptions $options |
||
653 | * @param array $messageOptions (OPTIONAL) |
||
654 | * @return Result |
||
655 | */ |
||
656 | 1 | public function airFlightInfo(RequestOptions\AirFlightInfoOptions $options, $messageOptions = []) |
|
662 | |||
663 | /** |
||
664 | * Air_RetrieveSeatMap |
||
665 | * |
||
666 | * @param RequestOptions\AirRetrieveSeatMapOptions $options |
||
667 | * @param array $messageOptions (OPTIONAL) |
||
668 | * @return Result |
||
669 | */ |
||
670 | 1 | public function airRetrieveSeatMap(RequestOptions\AirRetrieveSeatMapOptions $options, $messageOptions = []) |
|
676 | |||
677 | /** |
||
678 | * Command_Cryptic |
||
679 | * |
||
680 | * @param RequestOptions\CommandCrypticOptions $options |
||
681 | * @param array $messageOptions (OPTIONAL) |
||
682 | * @return Result |
||
683 | */ |
||
684 | 1 | public function commandCryptic(RequestOptions\CommandCrypticOptions $options, $messageOptions = []) |
|
685 | { |
||
686 | 1 | $msgName = 'Command_Cryptic'; |
|
687 | |||
688 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
689 | } |
||
690 | |||
691 | /** |
||
692 | * MiniRule_GetFromPricingRec |
||
693 | * |
||
694 | * @param RequestOptions\MiniRuleGetFromPricingRecOptions $options |
||
695 | * @param array $messageOptions (OPTIONAL) |
||
696 | * @return Result |
||
697 | */ |
||
698 | 1 | public function miniRuleGetFromPricingRec( |
|
699 | RequestOptions\MiniRuleGetFromPricingRecOptions $options, |
||
700 | $messageOptions = [] |
||
701 | ) { |
||
702 | 1 | $msgName = 'MiniRule_GetFromPricingRec'; |
|
703 | |||
704 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
705 | } |
||
706 | |||
707 | /** |
||
708 | * MiniRule_GetFromPricing |
||
709 | * |
||
710 | * @param RequestOptions\MiniRuleGetFromPricingOptions $options |
||
711 | * @param array $messageOptions (OPTIONAL) |
||
712 | * @return Result |
||
713 | */ |
||
714 | 1 | public function miniRuleGetFromPricing( |
|
722 | |||
723 | /** |
||
724 | * Info_EncodeDecodeCity |
||
725 | * |
||
726 | * @param RequestOptions\InfoEncodeDecodeCityOptions $options |
||
727 | * @param array $messageOptions (OPTIONAL) |
||
728 | * @return Result |
||
729 | */ |
||
730 | 1 | public function infoEncodeDecodeCity(RequestOptions\InfoEncodeDecodeCityOptions $options, $messageOptions = []) |
|
736 | |||
737 | /** |
||
738 | * PointOfRef_Search |
||
739 | * |
||
740 | * @param RequestOptions\PointOfRefSearchOptions $options |
||
741 | * @param array $messageOptions (OPTIONAL) |
||
742 | * @return Result |
||
743 | */ |
||
744 | 1 | public function pointOfRefSearch(RequestOptions\PointOfRefSearchOptions $options, $messageOptions = []) |
|
745 | { |
||
746 | 1 | $msgName = 'PointOfRef_Search'; |
|
747 | |||
748 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
749 | } |
||
750 | |||
751 | |||
752 | /** |
||
753 | * Ticket_CreateTSTFromPricing |
||
754 | * |
||
755 | * @param RequestOptions\TicketCreateTstFromPricingOptions $options |
||
756 | * @param array $messageOptions (OPTIONAL) |
||
757 | * @return Result |
||
758 | */ |
||
759 | 1 | public function ticketCreateTSTFromPricing( |
|
760 | RequestOptions\TicketCreateTstFromPricingOptions $options, |
||
761 | $messageOptions = [] |
||
762 | ) { |
||
763 | 1 | $msgName = 'Ticket_CreateTSTFromPricing'; |
|
764 | |||
765 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
766 | } |
||
767 | |||
768 | /** |
||
769 | * Ticket_CreateTSMFromPricing |
||
770 | * |
||
771 | * @param RequestOptions\TicketCreateTsmFromPricingOptions $options |
||
772 | * @param array $messageOptions (OPTIONAL) |
||
773 | * @return Result |
||
774 | */ |
||
775 | 1 | public function ticketCreateTSMFromPricing( |
|
776 | RequestOptions\TicketCreateTsmFromPricingOptions $options, |
||
777 | $messageOptions = [] |
||
778 | ) { |
||
779 | 1 | $msgName = 'Ticket_CreateTSMFromPricing'; |
|
780 | |||
781 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
782 | } |
||
783 | |||
784 | /** |
||
785 | * Ticket_CreateTSMFareElement |
||
786 | * |
||
787 | * @param RequestOptions\TicketCreateTsmFareElOptions $options |
||
788 | * @param array $messageOptions (OPTIONAL) |
||
789 | * @return Result |
||
790 | */ |
||
791 | 1 | public function ticketCreateTSMFareElement( |
|
799 | |||
800 | /** |
||
801 | * Ticket_DeleteTST |
||
802 | * |
||
803 | * @param RequestOptions\TicketDeleteTstOptions $options |
||
804 | * @param array $messageOptions (OPTIONAL) |
||
805 | * @return Result |
||
806 | */ |
||
807 | 1 | public function ticketDeleteTST(RequestOptions\TicketDeleteTstOptions $options, $messageOptions = []) |
|
813 | |||
814 | /** |
||
815 | * Ticket_DeleteTSMP |
||
816 | * |
||
817 | * @param RequestOptions\TicketDeleteTsmpOptions $options |
||
818 | * @param array $messageOptions (OPTIONAL) |
||
819 | * @return Result |
||
820 | */ |
||
821 | 1 | public function ticketDeleteTSMP(RequestOptions\TicketDeleteTsmpOptions $options, $messageOptions = []) |
|
827 | |||
828 | /** |
||
829 | * Ticket_DisplayTST |
||
830 | * |
||
831 | * @param RequestOptions\TicketDisplayTstOptions $options |
||
832 | * @param array $messageOptions (OPTIONAL) |
||
833 | * @return Result |
||
834 | */ |
||
835 | 1 | public function ticketDisplayTST(RequestOptions\TicketDisplayTstOptions $options, $messageOptions = []) |
|
841 | |||
842 | /** |
||
843 | * Ticket_DisplayTSMP |
||
844 | * |
||
845 | * @param RequestOptions\TicketDisplayTsmpOptions $options |
||
846 | * @param array $messageOptions (OPTIONAL) |
||
847 | * @return Result |
||
848 | */ |
||
849 | 1 | public function ticketDisplayTSMP(RequestOptions\TicketDisplayTsmpOptions $options, $messageOptions = []) |
|
850 | { |
||
851 | 1 | $msgName = 'Ticket_DisplayTSMP'; |
|
852 | |||
853 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
854 | } |
||
855 | |||
856 | /** |
||
857 | * Ticket_DisplayTSMFareElement |
||
858 | * |
||
859 | * @param RequestOptions\TicketDisplayTsmFareElOptions $options |
||
860 | * @param array $messageOptions (OPTIONAL) |
||
861 | * @return Result |
||
862 | */ |
||
863 | 1 | public function ticketDisplayTSMFareElement( |
|
864 | RequestOptions\TicketDisplayTsmFareElOptions $options, |
||
865 | $messageOptions = [] |
||
866 | ) { |
||
867 | 1 | $msgName = 'Ticket_DisplayTSMFareElement'; |
|
868 | |||
869 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
870 | } |
||
871 | |||
872 | /** |
||
873 | * Ticket_CheckEligibility |
||
874 | * |
||
875 | * @param RequestOptions\TicketCheckEligibilityOptions $options |
||
876 | * @param array $messageOptions (OPTIONAL) |
||
877 | * @return Result |
||
878 | */ |
||
879 | 1 | public function ticketCheckEligibility( |
|
880 | RequestOptions\TicketCheckEligibilityOptions $options, |
||
881 | $messageOptions = [] |
||
882 | ) { |
||
883 | 1 | $msgName = 'Ticket_CheckEligibility'; |
|
884 | |||
885 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
886 | } |
||
887 | |||
888 | /** |
||
889 | * Ticket_ATCShopperMasterPricerTravelBoardSearch |
||
890 | * |
||
891 | * @param RequestOptions\TicketAtcShopperMpTbSearchOptions $options |
||
892 | * @param array $messageOptions (OPTIONAL) |
||
893 | * @return Result |
||
894 | */ |
||
895 | 1 | public function ticketAtcShopperMasterPricerTravelBoardSearch( |
|
896 | RequestOptions\TicketAtcShopperMpTbSearchOptions $options, |
||
897 | $messageOptions = [] |
||
898 | ) { |
||
899 | 1 | $msgName = 'Ticket_ATCShopperMasterPricerTravelBoardSearch'; |
|
900 | |||
901 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
902 | } |
||
903 | |||
904 | /** |
||
905 | * Ticket_RepricePNRWithBookingClass |
||
906 | * |
||
907 | * @param RequestOptions\TicketRepricePnrWithBookingClassOptions $options |
||
908 | * @param array $messageOptions (OPTIONAL) |
||
909 | * @return Result |
||
910 | */ |
||
911 | 1 | public function ticketRepricePnrWithBookingClass( |
|
912 | RequestOptions\TicketRepricePnrWithBookingClassOptions $options, |
||
913 | $messageOptions = [] |
||
914 | ) { |
||
915 | 1 | $msgName = 'Ticket_RepricePNRWithBookingClass'; |
|
916 | |||
917 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
918 | } |
||
919 | |||
920 | /** |
||
921 | * Ticket_ReissueConfirmedPricing |
||
922 | * |
||
923 | * @param RequestOptions\TicketReissueConfirmedPricingOptions $options |
||
924 | * @param array $messageOptions (OPTIONAL) |
||
925 | * @return Result |
||
926 | */ |
||
927 | 1 | public function ticketReissueConfirmedPricing( |
|
928 | RequestOptions\TicketReissueConfirmedPricingOptions $options, |
||
929 | $messageOptions = [] |
||
930 | ) { |
||
931 | 1 | $msgName = 'Ticket_ReissueConfirmedPricing'; |
|
932 | |||
933 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
934 | } |
||
935 | |||
936 | /** |
||
937 | * DocIssuance_IssueTicket |
||
938 | * |
||
939 | * @param RequestOptions\DocIssuanceIssueTicketOptions $options |
||
940 | * @param array $messageOptions (OPTIONAL) |
||
941 | * @return Result |
||
942 | */ |
||
943 | 1 | public function docIssuanceIssueTicket( |
|
944 | RequestOptions\DocIssuanceIssueTicketOptions $options, |
||
945 | $messageOptions = [] |
||
946 | ) { |
||
947 | 1 | $msgName = 'DocIssuance_IssueTicket'; |
|
948 | |||
949 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
950 | } |
||
951 | |||
952 | /** |
||
953 | * DocIssuance_IssueMiscellaneousDocuments |
||
954 | * |
||
955 | * @param RequestOptions\DocIssuanceIssueMiscDocOptions $options |
||
956 | * @param array $messageOptions (OPTIONAL) |
||
957 | * @return Result |
||
958 | */ |
||
959 | 1 | public function docIssuanceIssueMiscellaneousDocuments( |
|
960 | RequestOptions\DocIssuanceIssueMiscDocOptions $options, |
||
961 | $messageOptions = [] |
||
962 | ) { |
||
963 | 1 | $msgName = 'DocIssuance_IssueMiscellaneousDocuments'; |
|
964 | |||
965 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
966 | } |
||
967 | |||
968 | /** |
||
969 | * DocIssuance_IssueCombined |
||
970 | * |
||
971 | * @param RequestOptions\DocIssuanceIssueCombinedOptions $options |
||
972 | * @param array $messageOptions (OPTIONAL) |
||
973 | * @return Result |
||
974 | */ |
||
975 | 2 | public function docIssuanceIssueCombined( |
|
976 | RequestOptions\DocIssuanceIssueCombinedOptions $options, |
||
977 | $messageOptions = [] |
||
978 | ) { |
||
979 | 2 | $msgName = 'DocIssuance_IssueCombined'; |
|
980 | |||
981 | 2 | return $this->callMessage($msgName, $options, $messageOptions); |
|
982 | } |
||
983 | |||
984 | /** |
||
985 | * DocRefund_InitRefund |
||
986 | * |
||
987 | * @param RequestOptions\DocRefundInitRefundOptions $options |
||
988 | * @param array $messageOptions (OPTIONAL) |
||
989 | * @return Result |
||
990 | */ |
||
991 | 1 | public function docRefundInitRefund( |
|
992 | RequestOptions\DocRefundInitRefundOptions $options, |
||
993 | $messageOptions = [] |
||
994 | ) { |
||
995 | 1 | $msgName = 'DocRefund_InitRefund'; |
|
996 | |||
997 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
998 | } |
||
999 | |||
1000 | /** |
||
1001 | * DocRefund_UpdateRefund |
||
1002 | * |
||
1003 | * @param RequestOptions\DocRefundUpdateRefundOptions $options |
||
1004 | * @param array $messageOptions (OPTIONAL) |
||
1005 | * @return Result |
||
1006 | */ |
||
1007 | 1 | public function docRefundUpdateRefund( |
|
1015 | |||
1016 | /** |
||
1017 | * DocRefund_ProcessRefund |
||
1018 | * |
||
1019 | * @param RequestOptions\DocRefundProcessRefundOptions $options |
||
1020 | * @param array $messageOptions (OPTIONAL) |
||
1021 | * @return Result |
||
1022 | */ |
||
1023 | 1 | public function docRefundProcessRefund( |
|
1024 | RequestOptions\DocRefundProcessRefundOptions $options, |
||
1025 | $messageOptions = [] |
||
1026 | ) { |
||
1027 | 1 | $msgName = 'DocRefund_ProcessRefund'; |
|
1028 | |||
1029 | 1 | return $this->callMessage($msgName, $options, $messageOptions); |
|
1030 | } |
||
1031 | |||
1032 | |||
1033 | /** |
||
1034 | * FOP_CreateFormOfPayment |
||
1035 | * |
||
1036 | * @param RequestOptions\FopCreateFopOptions $options |
||
1037 | * @param array $messageOptions (OPTIONAL) |
||
1038 | * @return Result |
||
1039 | */ |
||
1040 | 1 | public function fopCreateFormOfPayment(RequestOptions\FopCreateFopOptions $options, $messageOptions = []) |
|
1046 | |||
1047 | |||
1048 | /** |
||
1049 | * FOP_CreateFormOfPayment |
||
1050 | * |
||
1051 | * @param RequestOptions\FopValidateFopOptions $options |
||
1052 | * @param array $messageOptions (OPTIONAL) |
||
1053 | * @return Result |
||
1054 | */ |
||
1055 | 1 | public function fopValidateFOP(RequestOptions\FopValidateFopOptions $options, $messageOptions = []) |
|
1061 | |||
1062 | /** |
||
1063 | * PriceXplorer_ExtremeSearch |
||
1064 | * |
||
1065 | * @param RequestOptions\PriceXplorerExtremeSearchOptions $options |
||
1066 | * @param array $messageOptions (OPTIONAL) |
||
1067 | * @return Result |
||
1068 | */ |
||
1069 | 1 | public function priceXplorerExtremeSearch( |
|
1077 | |||
1078 | /** |
||
1079 | * SalesReports_DisplayQueryReport |
||
1080 | * |
||
1081 | * @param RequestOptions\SalesReportsDisplayQueryReportOptions $options |
||
1082 | * @param array $messageOptions (OPTIONAL) |
||
1083 | * @return Result |
||
1084 | */ |
||
1085 | 1 | public function salesReportsDisplayQueryReport( |
|
1093 | |||
1094 | /** |
||
1095 | * Service_IntegratedPricing |
||
1096 | * |
||
1097 | * @param RequestOptions\ServiceIntegratedPricingOptions $options |
||
1098 | * @param array $messageOptions (OPTIONAL) |
||
1099 | * @return Result |
||
1100 | */ |
||
1101 | 1 | public function serviceIntegratedPricing( |
|
1109 | |||
1110 | /** |
||
1111 | * Service_IntegratedCatalogue |
||
1112 | * |
||
1113 | * @param RequestOptions\ServiceIntegratedCatalogueOptions $options |
||
1114 | * @param array $messageOptions (OPTIONAL) |
||
1115 | * @return Result |
||
1116 | */ |
||
1117 | 1 | public function serviceIntegratedCatalogue( |
|
1125 | |||
1126 | /** |
||
1127 | * Call a message with the given parameters |
||
1128 | * |
||
1129 | * @param string $messageName |
||
1130 | * @param RequestOptions\RequestOptionsInterface $options |
||
1131 | * @param array $messageOptions |
||
1132 | * @param bool $endSession |
||
1133 | * @return Result |
||
1134 | * @throws Client\Exception |
||
1135 | * @throws Client\Struct\InvalidArgumentException |
||
1136 | * @throws Client\InvalidMessageException |
||
1137 | * @throws Client\RequestCreator\MessageVersionUnsupportedException |
||
1138 | * @throws \RuntimeException |
||
1139 | * @throws \InvalidArgumentException |
||
1140 | */ |
||
1141 | 68 | protected function callMessage($messageName, $options, $messageOptions, $endSession = false) |
|
1167 | |||
1168 | /** |
||
1169 | * Make message options |
||
1170 | * |
||
1171 | * Message options are meta options when sending a message to the amadeus web services |
||
1172 | * - 'endSession' (if stateful) : should we end the current session after sending this call? |
||
1173 | * - 'returnXml' : Should we return the XML string in the Result::responseXml property? |
||
1174 | * (this overrides the default setting returnXml in the Amadeus\Client\Params for a single message) |
||
1175 | * |
||
1176 | * @param array $incoming The Message options chosen by the caller - if any. |
||
1177 | * @param bool $endSession Switch if you want to terminate the current session after making the call. |
||
1178 | * @return array |
||
1179 | */ |
||
1180 | 74 | protected function makeMessageOptions(array $incoming, $endSession = false) |
|
1197 | } |
||
1198 |