Completed
Pull Request — master (#248)
by Dieter
06:54
created

Cabin::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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\RequestOptions\Fare\InformativeBestPricingWithoutPnr;
24
25
use Amadeus\Client\Struct\Fare\PricePnr13\CriteriaDetails;
26
27
/**
28
 * Cabin
29
 *
30
 * new Cabin(
31
 *   [
32
 *     new CriteriaDetails(Cabin::TYPE_FIRST_CABIN, Cabin::CLASS_BUSINESS),
33
 *     new CriteriaDetails(Cabin::TYPE_SECOND_CABIN, Cabin::CLASS_PREMIUM_ECONOMY)
34
 *   ]
35
 * )
36
 *
37
 * @package Amadeus\Client\RequestOptions\Fare\PricePnr
38
 * @author  tsari <[email protected]>
39
 */
40
class Cabin
41
{
42
    /**
43
     * Search only in the original cabin (the one from the segment)
44
     */
45
    const TYPE_DEFAULT = 'K';
46
47
    /**
48
     * Search only in the cabin(s) provided as "first cabin".
49
     */
50
    const TYPE_FIRST_CABIN = 'FC';
51
52
    /**
53
     * Search first in the cabin(s) provided as "first cabin", then in the cabin(s) provided as "second cabin".
54
     *
55
     * Note: must be used together with the "first cabin".
56
     */
57
    const TYPE_SECOND_CABIN = 'SC';
58
59
    /**
60
     * Search first in the cabin(s) provided as "first cabin", then in the cabin(s) provided as "second cabin",
61
     * and finally in the cabin(s) provided as "third cabin".
62
     *
63
     * Note: must be used together with the "first cabin" and "second cabin".
64
     */
65
    const TYPE_THIRD_CABIN = 'TC';
66
67
    /**
68
     * In case no fare is found in the cabin(s) provided with above option, defaults to any cabin.
69
     */
70
    const TYPE_DEFAULT_CABIN = 'P';
71
72
    const CLASS_FIRST            = 'F';
73
    const CLASS_BUSINESS         = 'C';
74
    const CLASS_ECONOMY          = 'Y';
75
    const CLASS_STANDARD_ECONOMY = 'M';
76
    const CLASS_PREMIUM_ECONOMY  = 'W';
77
78
    /**
79
     * @var array|CriteriaDetails[]
80
     */
81
    public $criteriaDetails = [];
82
83
    /**
84
     * Cabin constructor.
85
     *
86
     * @param CriteriaDetails[]|array $criteriaDetails
87
     */
88 4
    public function __construct($criteriaDetails)
89
    {
90 4
        $this->criteriaDetails = $criteriaDetails;
91 4
    }
92
}
93