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\Struct\Pnr\Retrieve; |
24
|
|
|
|
25
|
|
|
use Amadeus\Client\Struct\Pnr\AddMultiElements\BoardOffPointDetail; |
26
|
|
|
use Amadeus\Client\Struct\Pnr\AddMultiElements\Product; |
27
|
|
|
use Amadeus\Client\Struct\Pnr\AddMultiElements\ProductDetails; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* ProductInformation |
31
|
|
|
* |
32
|
|
|
* @package Amadeus\Client\Struct\Pnr\Retrieve |
33
|
|
|
* @author Dieter Devlieghere <[email protected]> |
34
|
|
|
*/ |
35
|
|
|
class ProductInformation |
36
|
|
|
{ |
37
|
|
|
/** |
38
|
|
|
* @var Product |
39
|
|
|
*/ |
40
|
|
|
public $product; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var BoardOffPointDetail |
44
|
|
|
*/ |
45
|
|
|
public $boardpointDetail; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var BoardOffPointDetail |
49
|
|
|
*/ |
50
|
|
|
public $offpointDetail; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @var Company |
54
|
|
|
*/ |
55
|
|
|
public $company; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var ProductDetails |
59
|
|
|
*/ |
60
|
|
|
public $productDetails; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* ProductInformation constructor. |
64
|
|
|
* |
65
|
|
|
* @param \DateTime|null $departureDate |
66
|
|
|
* @param string|null $company |
67
|
|
|
* @param string|null $flightNumber |
68
|
|
|
*/ |
69
|
2 |
|
public function __construct($departureDate, $company, $flightNumber) |
70
|
|
|
{ |
71
|
2 |
|
if ($departureDate instanceof \DateTime) { |
72
|
2 |
|
$this->product = new Product($departureDate); |
73
|
2 |
|
} |
74
|
|
|
|
75
|
2 |
|
if ($company) { |
|
|
|
|
76
|
1 |
|
$this->company = new Company($company); |
77
|
1 |
|
} |
78
|
|
|
|
79
|
2 |
|
if ($flightNumber) { |
|
|
|
|
80
|
1 |
|
$this->productDetails = new ProductDetails($flightNumber); |
81
|
1 |
|
} |
82
|
2 |
|
} |
83
|
|
|
} |
84
|
|
|
|
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: