1 | <?php |
||
67 | class Base implements RequestCreatorInterface |
||
68 | { |
||
69 | /** |
||
70 | * @var RequestCreatorParams |
||
71 | */ |
||
72 | protected $params; |
||
73 | |||
74 | /** |
||
75 | * Associative array of messages (as keys) and versions (as values) that are present in the WSDL. |
||
76 | * |
||
77 | * @var array |
||
78 | */ |
||
79 | protected $messagesAndVersions = []; |
||
80 | |||
81 | /** |
||
82 | * @param $params |
||
83 | */ |
||
84 | public function __construct(RequestCreatorParams $params) |
||
89 | |||
90 | /** |
||
91 | * @param string $messageName the message name as named in the WSDL |
||
92 | * @param RequestOptionsInterface $params |
||
93 | * @throws Struct\InvalidArgumentException When invalid input is detected during message creation. |
||
94 | * @throws InvalidMessageException when trying to create a request for a message that is not in your WSDL. |
||
95 | * @return mixed the created request |
||
96 | */ |
||
97 | public function createRequest($messageName, RequestOptionsInterface $params) |
||
109 | |||
110 | /** |
||
111 | * @return Struct\Security\SignOut |
||
112 | */ |
||
113 | protected function createSecuritySignOut() |
||
117 | |||
118 | /** |
||
119 | * Create request object for Security_Authenticate message |
||
120 | * |
||
121 | * @param SecurityAuthenticateOptions $params |
||
122 | * @return Struct\Security\Authenticate |
||
123 | */ |
||
124 | protected function createSecurityAuthenticate(SecurityAuthenticateOptions $params) |
||
128 | |||
129 | /** |
||
130 | * Create request object for PNR_Retrieve message |
||
131 | * |
||
132 | * @param PnrRetrieveOptions $params |
||
133 | * @return Struct\Pnr\Retrieve |
||
134 | */ |
||
135 | protected function createPNRRetrieve(PnrRetrieveOptions $params) |
||
144 | |||
145 | /** |
||
146 | * @param PnrRetrieveAndDisplayOptions $params |
||
147 | * @return Struct\Pnr\RetrieveAndDisplay |
||
148 | */ |
||
149 | protected function createPNRRetrieveAndDisplay(PnrRetrieveAndDisplayOptions $params) |
||
158 | |||
159 | /** |
||
160 | * @param PnrAddMultiElementsBase $params |
||
161 | * @return Struct\Pnr\AddMultiElements |
||
162 | */ |
||
163 | protected function createPNRAddMultiElements(PnrAddMultiElementsBase $params) |
||
174 | |||
175 | /** |
||
176 | * @param PnrCancelOptions $params |
||
177 | * @return Struct\Pnr\Cancel |
||
178 | */ |
||
179 | protected function createPNRCancel(PnrCancelOptions $params) |
||
183 | |||
184 | /** |
||
185 | * @param PnrDisplayHistoryOptions $params |
||
186 | * @return Struct\Pnr\Cancel |
||
|
|||
187 | */ |
||
188 | protected function createPNRDisplayHistory(PnrDisplayHistoryOptions $params) |
||
192 | |||
193 | /** |
||
194 | * @param QueueListOptions $params |
||
195 | * @return Struct\Queue\QueueList |
||
196 | */ |
||
197 | protected function createQueueList(QueueListOptions $params) |
||
206 | |||
207 | /** |
||
208 | * @param QueuePlacePnrOptions $params |
||
209 | * @return Struct\Queue\PlacePnr |
||
210 | */ |
||
211 | protected function createQueuePlacePnr(QueuePlacePnrOptions $params) |
||
221 | |||
222 | /** |
||
223 | * @param QueueRemoveItemOptions $params |
||
224 | * @return Struct\Queue\RemoveItem |
||
225 | */ |
||
226 | protected function createQueueRemoveItem(QueueRemoveItemOptions $params) |
||
236 | |||
237 | /** |
||
238 | * @param QueueMoveItemOptions $params |
||
239 | * @return Struct\Queue\MoveItem |
||
240 | */ |
||
241 | protected function createQueueMoveItem(QueueMoveItemOptions $params) |
||
252 | |||
253 | /** |
||
254 | * @param OfferVerifyOptions $params |
||
255 | * @return Struct\Offer\Verify |
||
256 | */ |
||
257 | protected function createOfferVerifyOffer(OfferVerifyOptions $params) |
||
266 | |||
267 | /** |
||
268 | * @param OfferConfirmAirOptions $params |
||
269 | * @return Struct\Offer\ConfirmAir |
||
270 | */ |
||
271 | protected function createOfferConfirmAirOffer(OfferConfirmAirOptions $params) |
||
275 | |||
276 | |||
277 | /** |
||
278 | * @param OfferConfirmHotelOptions $params |
||
279 | * @return Struct\Offer\ConfirmHotel |
||
280 | */ |
||
281 | protected function createOfferConfirmHotelOffer(OfferConfirmHotelOptions $params) |
||
285 | |||
286 | /** |
||
287 | * @param OfferConfirmCarOptions $params |
||
288 | * @return Struct\Offer\ConfirmCar |
||
289 | */ |
||
290 | protected function createOfferConfirmCarOffer(OfferConfirmCarOptions $params) |
||
294 | |||
295 | /** |
||
296 | * createFareMasterPricerTravelBoardSearch |
||
297 | * |
||
298 | * @param FareMasterPricerTbSearch $params |
||
299 | * @return Struct\Fare\MasterPricerTravelBoardSearch |
||
300 | */ |
||
301 | protected function createFareMasterPricerTravelBoardSearch(FareMasterPricerTbSearch $params) |
||
305 | |||
306 | |||
307 | /** |
||
308 | * createFareCheckRules |
||
309 | * |
||
310 | * @param FareCheckRulesOptions $params |
||
311 | * @return Struct\Fare\CheckRules |
||
312 | */ |
||
313 | protected function createFareCheckRules(FareCheckRulesOptions $params) |
||
317 | |||
318 | /** |
||
319 | * createFareConvertCurrency |
||
320 | * |
||
321 | * @param FareConvertCurrencyOptions $params |
||
322 | * @return Struct\Fare\ConvertCurrency |
||
323 | */ |
||
324 | protected function createFareConvertCurrency(FareConvertCurrencyOptions $params) |
||
328 | |||
329 | /** |
||
330 | * makeFarePricePnrWithBookingClass |
||
331 | * |
||
332 | * @param FarePricePnrWithBookingClassOptions $params |
||
333 | * @return Struct\Fare\PricePNRWithBookingClass12|Struct\Fare\PricePNRWithBookingClass13 |
||
334 | */ |
||
335 | protected function createFarePricePnrWithBookingClass(FarePricePnrWithBookingClassOptions $params) |
||
344 | |||
345 | /** |
||
346 | * createFareInformativePricingWithoutPNR |
||
347 | * |
||
348 | * @param FareInformativePricingWithoutPnrOptions $params |
||
349 | * @return Struct\Fare\InformativePricingWithoutPNR12|Struct\Fare\InformativePricingWithoutPNR13 |
||
350 | */ |
||
351 | protected function createFareInformativePricingWithoutPNR(FareInformativePricingWithoutPnrOptions $params) |
||
360 | |||
361 | /** |
||
362 | * |
||
363 | * @param AirSellFromRecommendationOptions $params |
||
364 | * @return Struct\Air\SellFromRecommendation |
||
365 | */ |
||
366 | protected function createAirSellFromRecommendation(AirSellFromRecommendationOptions $params) |
||
370 | |||
371 | /** |
||
372 | * |
||
373 | * @param AirFlightInfoOptions $params |
||
374 | * @return Struct\Air\FlightInfo |
||
375 | */ |
||
376 | protected function createAirFlightInfo(AirFlightInfoOptions $params) |
||
380 | |||
381 | /** |
||
382 | * @param AirRetrieveSeatMapOptions $params |
||
383 | * @return Struct\Air\RetrieveSeatMap |
||
384 | */ |
||
385 | protected function createAirRetrieveSeatMap(AirRetrieveSeatMapOptions $params) |
||
389 | |||
390 | /** |
||
391 | * makeCommandCryptic |
||
392 | * |
||
393 | * @param CommandCrypticOptions $params |
||
394 | * @return Struct\Command\Cryptic |
||
395 | */ |
||
396 | protected function createCommandCryptic(CommandCrypticOptions $params) |
||
400 | |||
401 | /** |
||
402 | * Info_EncodeDecodeCity |
||
403 | * |
||
404 | * @param InfoEncodeDecodeCityOptions $params |
||
405 | * @return Struct\Info\EncodeDecodeCity |
||
406 | */ |
||
407 | protected function createInfoEncodeDecodeCity(InfoEncodeDecodeCityOptions $params) |
||
411 | |||
412 | /** |
||
413 | * makeMiniRuleGetFromPricingRec |
||
414 | * |
||
415 | * @param MiniRuleGetFromPricingRecOptions $params |
||
416 | * @return Struct\MiniRule\GetFromPricingRec |
||
417 | */ |
||
418 | protected function createMiniRuleGetFromPricingRec(MiniRuleGetFromPricingRecOptions $params) |
||
422 | |||
423 | /** |
||
424 | * Ticket_CreateTstFromPricing |
||
425 | * |
||
426 | * @param TicketCreateTstFromPricingOptions $params |
||
427 | * @return Struct\Ticket\CreateTSTFromPricing |
||
428 | */ |
||
429 | protected function createTicketCreateTSTFromPricing(TicketCreateTstFromPricingOptions $params) |
||
433 | |||
434 | /** |
||
435 | * DocIssuance_IssueTicket |
||
436 | * |
||
437 | * @param DocIssuanceIssueTicketOptions $params |
||
438 | * @return Struct\DocIssuance\IssueTicket |
||
439 | */ |
||
440 | protected function createDocIssuanceIssueTicket(DocIssuanceIssueTicketOptions $params) |
||
444 | |||
445 | /** |
||
446 | * PriceXplorer_ExtremeSearch |
||
447 | * |
||
448 | * @param PriceXplorerExtremeSearchOptions $params |
||
449 | * @return Struct\PriceXplorer\ExtremeSearch |
||
450 | */ |
||
451 | protected function createPriceXplorerExtremeSearch(PriceXplorerExtremeSearchOptions $params) |
||
455 | |||
456 | /** |
||
457 | * Check if a given message is in the active WSDL. Throws exception if it isn't. |
||
458 | * |
||
459 | * @throws InvalidMessageException if message is not in WSDL. |
||
460 | * @param string $messageName |
||
461 | */ |
||
462 | protected function checkMessageIsInWsdl($messageName) |
||
468 | |||
469 | /** |
||
470 | * Get the version number active in the WSDL for the given message |
||
471 | * |
||
472 | * @param $messageName |
||
473 | * @return float|string |
||
474 | */ |
||
475 | protected function getActiveVersionFor($messageName) |
||
479 | } |
||
480 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.