UnitReservation::setID_Guest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Gueststream\PMS\IQWare\API;
4
5
class UnitReservation
6
{
7
8
    /**
9
     * @var int $ID_Guest
10
     */
11
    protected $ID_Guest = null;
12
13
    /**
14
     * @var \DateTime $ArrivalDate
15
     */
16
    protected $ArrivalDate = null;
17
18
    /**
19
     * @var \DateTime $DepartureDate
20
     */
21
    protected $DepartureDate = null;
22
23
    /**
24
     * @var TBookingCondoType $BookingCondoType
25
     */
26
    protected $BookingCondoType = null;
27
28
    /**
29
     * @var \DateTime $SystemCreationDate
30
     */
31
    protected $SystemCreationDate = null;
32
33
    /**
34
     * @var float $GrossRevenue
35
     */
36
    protected $GrossRevenue = null;
37
38
    /**
39
     * @var string $RateCodeName
40
     */
41
    protected $RateCodeName = null;
42
43
    /**
44
     * @param int $ID_Guest
45
     * @param \DateTime $ArrivalDate
46
     * @param \DateTime $DepartureDate
47
     * @param TBookingCondoType $BookingCondoType
48
     * @param \DateTime $SystemCreationDate
49
     * @param float $GrossRevenue
50
     */
51 View Code Duplication
    public function __construct($ID_Guest, \DateTime $ArrivalDate, \DateTime $DepartureDate, $BookingCondoType, \DateTime $SystemCreationDate, $GrossRevenue)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
52
    {
53
        $this->ID_Guest = $ID_Guest;
54
        $this->ArrivalDate = $ArrivalDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $ArrivalDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $ArrivalDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
55
        $this->DepartureDate = $DepartureDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $DepartureDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $DepartureDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
56
        $this->BookingCondoType = $BookingCondoType;
57
        $this->SystemCreationDate = $SystemCreationDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $SystemCreationDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $SystemCreationDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
58
        $this->GrossRevenue = $GrossRevenue;
59
    }
60
61
    /**
62
     * @return int
63
     */
64
    public function getID_Guest()
65
    {
66
        return $this->ID_Guest;
67
    }
68
69
    /**
70
     * @param int $ID_Guest
71
     * @return \Gueststream\PMS\IQWare\API\UnitReservation
72
     */
73
    public function setID_Guest($ID_Guest)
74
    {
75
        $this->ID_Guest = $ID_Guest;
76
        return $this;
77
    }
78
79
    /**
80
     * @return \DateTime
81
     */
82
    public function getArrivalDate()
83
    {
84
        if ($this->ArrivalDate == null) {
85
            return null;
86
        } else {
87
            try {
88
                return new \DateTime($this->ArrivalDate);
89
            } catch (\Exception $e) {
90
                return false;
91
            }
92
        }
93
    }
94
95
    /**
96
     * @param \DateTime $ArrivalDate
97
     * @return \Gueststream\PMS\IQWare\API\UnitReservation
98
     */
99
    public function setArrivalDate(\DateTime $ArrivalDate)
100
    {
101
        $this->ArrivalDate = $ArrivalDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $ArrivalDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $ArrivalDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
102
        return $this;
103
    }
104
105
    /**
106
     * @return \DateTime
107
     */
108
    public function getDepartureDate()
109
    {
110
        if ($this->DepartureDate == null) {
111
            return null;
112
        } else {
113
            try {
114
                return new \DateTime($this->DepartureDate);
115
            } catch (\Exception $e) {
116
                return false;
117
            }
118
        }
119
    }
120
121
    /**
122
     * @param \DateTime $DepartureDate
123
     * @return \Gueststream\PMS\IQWare\API\UnitReservation
124
     */
125
    public function setDepartureDate(\DateTime $DepartureDate)
126
    {
127
        $this->DepartureDate = $DepartureDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $DepartureDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $DepartureDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
128
        return $this;
129
    }
130
131
    /**
132
     * @return TBookingCondoType
133
     */
134
    public function getBookingCondoType()
135
    {
136
        return $this->BookingCondoType;
137
    }
138
139
    /**
140
     * @param TBookingCondoType $BookingCondoType
141
     * @return \Gueststream\PMS\IQWare\API\UnitReservation
142
     */
143
    public function setBookingCondoType($BookingCondoType)
144
    {
145
        $this->BookingCondoType = $BookingCondoType;
146
        return $this;
147
    }
148
149
    /**
150
     * @return \DateTime
151
     */
152
    public function getSystemCreationDate()
153
    {
154
        if ($this->SystemCreationDate == null) {
155
            return null;
156
        } else {
157
            try {
158
                return new \DateTime($this->SystemCreationDate);
159
            } catch (\Exception $e) {
160
                return false;
161
            }
162
        }
163
    }
164
165
    /**
166
     * @param \DateTime $SystemCreationDate
167
     * @return \Gueststream\PMS\IQWare\API\UnitReservation
168
     */
169
    public function setSystemCreationDate(\DateTime $SystemCreationDate)
170
    {
171
        $this->SystemCreationDate = $SystemCreationDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $SystemCreationDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $SystemCreationDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
172
        return $this;
173
    }
174
175
    /**
176
     * @return float
177
     */
178
    public function getGrossRevenue()
179
    {
180
        return $this->GrossRevenue;
181
    }
182
183
    /**
184
     * @param float $GrossRevenue
185
     * @return \Gueststream\PMS\IQWare\API\UnitReservation
186
     */
187
    public function setGrossRevenue($GrossRevenue)
188
    {
189
        $this->GrossRevenue = $GrossRevenue;
190
        return $this;
191
    }
192
193
    /**
194
     * @return string
195
     */
196
    public function getRateCodeName()
197
    {
198
        return $this->RateCodeName;
199
    }
200
201
    /**
202
     * @param string $RateCodeName
203
     * @return \Gueststream\PMS\IQWare\API\UnitReservation
204
     */
205
    public function setRateCodeName($RateCodeName)
206
    {
207
        $this->RateCodeName = $RateCodeName;
208
        return $this;
209
    }
210
}
211