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