Completed
Push — master ( d76d99...0fe829 )
by Dieter
07:42
created

Fare::createFareMasterPricerTravelBoardSearch()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * amadeus-ws-client
4
 *
5
 * Copyright 2015 Amadeus Benelux NV
6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
10
 *
11
 * http://www.apache.org/licenses/LICENSE-2.0
12
 *
13
 * Unless required by applicable law or agreed to in writing, software
14
 * distributed under the License is distributed on an "AS IS" BASIS,
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 *
19
 * @package Amadeus
20
 * @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
21
 */
22
23
namespace Amadeus\Client\RequestCreator;
24
25
use Amadeus\Client\RequestOptions\FareCheckRulesOptions;
26
use Amadeus\Client\RequestOptions\FareConvertCurrencyOptions;
27
use Amadeus\Client\RequestOptions\FareInformativeBestPricingWithoutPnrOptions;
28
use Amadeus\Client\RequestOptions\FareInformativePricingWithoutPnrOptions;
29
use Amadeus\Client\RequestOptions\FareMasterPricerCalendarOptions;
30
use Amadeus\Client\RequestOptions\FareMasterPricerTbSearch;
31
use Amadeus\Client\RequestOptions\FarePricePnrWithBookingClassOptions;
32
use Amadeus\Client\Struct;
33
34
/**
35
 * Fare Request Creator
36
 *
37
 * Responsible for creating all "Fare_" messages
38
 *
39
 * methods for creation must have the correct name
40
 * 'create'<message name without underscores>
41
 *
42
 * @package Amadeus\Client\RequestCreator
43
 * @author Dieter Devlieghere <[email protected]>
44
 */
45
class Fare
46
{
47
    /**
48
     * createFareMasterPricerTravelBoardSearch
49
     *
50
     * @param FareMasterPricerTbSearch $params
51
     * @return Struct\Fare\MasterPricerTravelBoardSearch
52
     */
53
    public function createFareMasterPricerTravelBoardSearch(FareMasterPricerTbSearch $params)
54
    {
55
        return new Struct\Fare\MasterPricerTravelBoardSearch($params);
56
    }
57
58
    /**
59
     * createFareMasterPricerCalendar
60
     *
61
     * @param FareMasterPricerCalendarOptions $params
62
     * @return Struct\Fare\MasterPricerCalendar
63
     */
64
    public function createFareMasterPricerCalendar(FareMasterPricerCalendarOptions $params)
65
    {
66
        return new Struct\Fare\MasterPricerCalendar($params);
67
    }
68
69
70
    /**
71
     * createFareCheckRules
72
     *
73
     * @param FareCheckRulesOptions $params
74
     * @return Struct\Fare\CheckRules
75
     */
76
    public function createFareCheckRules(FareCheckRulesOptions $params)
77
    {
78
        return new Struct\Fare\CheckRules($params);
79
    }
80
81
    /**
82
     * createFareConvertCurrency
83
     *
84
     * @param FareConvertCurrencyOptions $params
85
     * @return Struct\Fare\ConvertCurrency
86
     */
87
    public function createFareConvertCurrency(FareConvertCurrencyOptions $params)
88
    {
89
        return new Struct\Fare\ConvertCurrency($params);
90
    }
91
92
    /**
93
     * makeFarePricePnrWithBookingClass
94
     *
95
     * @param FarePricePnrWithBookingClassOptions $params
96
     * @param string $version
97
     * @return Struct\Fare\PricePNRWithBookingClass12|Struct\Fare\PricePNRWithBookingClass13
98
     */
99
    public function createFarePricePnrWithBookingClass(FarePricePnrWithBookingClassOptions $params, $version)
100
    {
101
        if ($version < 13) {
102
            return new Struct\Fare\PricePNRWithBookingClass12($params);
103
        } else {
104
            return new Struct\Fare\PricePNRWithBookingClass13($params);
105
        }
106
    }
107
108
    /**
109
     * createFareInformativePricingWithoutPNR
110
     *
111
     * @param FareInformativePricingWithoutPnrOptions $params
112
     * @param string $version
113
     * @return Struct\Fare\InformativePricingWithoutPNR12|Struct\Fare\InformativePricingWithoutPNR13
114
     */
115
    public function createFareInformativePricingWithoutPNR(FareInformativePricingWithoutPnrOptions $params, $version)
116
    {
117
        if ($version < 13) {
118
            return new Struct\Fare\InformativePricingWithoutPNR12($params);
119
        } else {
120
            return new Struct\Fare\InformativePricingWithoutPNR13($params);
121
        }
122
    }
123
124
    /**
125
     * createFareInformativeBestPricingWithoutPNR
126
     *
127
     * @param FareInformativeBestPricingWithoutPnrOptions $params
128
     * @param string $version
129
     * @return Struct\Fare\InformativeBestPricingWithoutPNR12|Struct\Fare\InformativeBestPricingWithoutPNR13
130
     */
131
    public function createFareInformativeBestPricingWithoutPNR(
132
        FareInformativeBestPricingWithoutPnrOptions $params,
133
        $version
134
    ) {
135
        if ($version < 13) {
136
            return new Struct\Fare\InformativeBestPricingWithoutPNR12($params);
137
        } else {
138
            return new Struct\Fare\InformativeBestPricingWithoutPNR13($params);
139
        }
140
    }
141
}
142