Completed
Push — develop ( 85d412...a52dc0 )
by Dieter
07:33
created

TravelProductIdent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 11
rs 9.4285
cc 1
eloc 8
nc 1
nop 1
1
<?php
2
/**
3
 * Amadeus
4
 *
5
 * Copyright 2015 Amadeus Benelux NV
6
 */
7
8
namespace Amadeus\Client\Struct\Air\RetrieveSeatMap;
9
10
use Amadeus\Client\RequestOptions\Air\RetrieveSeatMap\FlightInfo;
11
use Amadeus\Client\Struct\Air\CompanyDetails;
12
use Amadeus\Client\Struct\Air\FlightDate;
13
use Amadeus\Client\Struct\Air\FlightIdentification;
14
use Amadeus\Client\Struct\Air\FlightTypeDetails;
15
use Amadeus\Client\Struct\Air\PointDetails;
16
17
/**
18
 * TravelProductIdent
19
 *
20
 * @package Amadeus\Client\Struct\Air\RetrieveSeatMap
21
 * @author Dieter Devlieghere <[email protected]>
22
 */
23
class TravelProductIdent
24
{
25
    /**
26
     * @var FlightDate
27
     */
28
    public $flightDate;
29
30
    /**
31
     * @var PointDetails
32
     */
33
    public $boardPointDetails;
34
35
    /**
36
     * @var PointDetails
37
     */
38
    public $offpointDetails;
39
40
    /**
41
     * @var CompanyDetails
42
     */
43
    public $companyDetails;
44
45
    /**
46
     * @var FlightIdentification
47
     */
48
    public $flightIdentification;
49
50
    /**
51
     * @var FlightTypeDetails
52
     */
53
    public $flightTypeDetails;
54
55
    /**
56
     * TravelProductIdent constructor.
57
     *
58
     * @param FlightInfo $flightInfo
59
     */
60
    public function __construct(FlightInfo $flightInfo)
61
    {
62
        $this->flightDate = new FlightDate($flightInfo->departureDate);
63
        $this->boardPointDetails = new PointDetails($flightInfo->departure);
64
        $this->offpointDetails = new PointDetails($flightInfo->arrival);
65
        $this->companyDetails = new CompanyDetails($flightInfo->airline);
66
        $this->flightIdentification = new FlightIdentification(
67
            $flightInfo->flightNumber,
68
            $flightInfo->bookingClass
69
        );
70
    }
71
}
72