1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Gueststream\PMS\IQWare\API; |
4
|
|
|
|
5
|
|
View Code Duplication |
class GetUnitStatements |
|
|
|
|
6
|
|
|
{ |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* @var int $intGUID |
10
|
|
|
*/ |
11
|
|
|
protected $intGUID = null; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* @var int $ID_Room |
15
|
|
|
*/ |
16
|
|
|
protected $ID_Room = null; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @var \DateTime $StartDate |
20
|
|
|
*/ |
21
|
|
|
protected $StartDate = null; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var \DateTime $EndDate |
25
|
|
|
*/ |
26
|
|
|
protected $EndDate = null; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @param int $intGUID |
30
|
|
|
* @param int $ID_Room |
31
|
|
|
* @param \DateTime $StartDate |
32
|
|
|
* @param \DateTime $EndDate |
33
|
|
|
*/ |
34
|
|
|
public function __construct($intGUID, $ID_Room, \DateTime $StartDate, \DateTime $EndDate) |
35
|
|
|
{ |
36
|
|
|
$this->intGUID = $intGUID; |
37
|
|
|
$this->ID_Room = $ID_Room; |
38
|
|
|
$this->StartDate = $StartDate->format(\DateTime::ATOM); |
|
|
|
|
39
|
|
|
$this->EndDate = $EndDate->format(\DateTime::ATOM); |
|
|
|
|
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @return int |
44
|
|
|
*/ |
45
|
|
|
public function getIntGUID() |
46
|
|
|
{ |
47
|
|
|
return $this->intGUID; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @param int $intGUID |
52
|
|
|
* @return \Gueststream\PMS\IQWare\API\GetUnitStatements |
53
|
|
|
*/ |
54
|
|
|
public function setIntGUID($intGUID) |
55
|
|
|
{ |
56
|
|
|
$this->intGUID = $intGUID; |
57
|
|
|
return $this; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @return int |
62
|
|
|
*/ |
63
|
|
|
public function getID_Room() |
64
|
|
|
{ |
65
|
|
|
return $this->ID_Room; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @param int $ID_Room |
70
|
|
|
* @return \Gueststream\PMS\IQWare\API\GetUnitStatements |
71
|
|
|
*/ |
72
|
|
|
public function setID_Room($ID_Room) |
73
|
|
|
{ |
74
|
|
|
$this->ID_Room = $ID_Room; |
75
|
|
|
return $this; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @return \DateTime |
80
|
|
|
*/ |
81
|
|
|
public function getStartDate() |
82
|
|
|
{ |
83
|
|
|
if ($this->StartDate == null) { |
84
|
|
|
return null; |
85
|
|
|
} else { |
86
|
|
|
try { |
87
|
|
|
return new \DateTime($this->StartDate); |
88
|
|
|
} catch (\Exception $e) { |
89
|
|
|
return false; |
90
|
|
|
} |
91
|
|
|
} |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @param \DateTime $StartDate |
96
|
|
|
* @return \Gueststream\PMS\IQWare\API\GetUnitStatements |
97
|
|
|
*/ |
98
|
|
|
public function setStartDate(\DateTime $StartDate) |
99
|
|
|
{ |
100
|
|
|
$this->StartDate = $StartDate->format(\DateTime::ATOM); |
|
|
|
|
101
|
|
|
return $this; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @return \DateTime |
106
|
|
|
*/ |
107
|
|
|
public function getEndDate() |
108
|
|
|
{ |
109
|
|
|
if ($this->EndDate == null) { |
110
|
|
|
return null; |
111
|
|
|
} else { |
112
|
|
|
try { |
113
|
|
|
return new \DateTime($this->EndDate); |
114
|
|
|
} catch (\Exception $e) { |
115
|
|
|
return false; |
116
|
|
|
} |
117
|
|
|
} |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @param \DateTime $EndDate |
122
|
|
|
* @return \Gueststream\PMS\IQWare\API\GetUnitStatements |
123
|
|
|
*/ |
124
|
|
|
public function setEndDate(\DateTime $EndDate) |
125
|
|
|
{ |
126
|
|
|
$this->EndDate = $EndDate->format(\DateTime::ATOM); |
|
|
|
|
127
|
|
|
return $this; |
128
|
|
|
} |
129
|
|
|
} |
130
|
|
|
|
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.