ContractSegments   A
last analyzed

Complexity

Total Complexity 13

Size/Duplication

Total Lines 125
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 13
lcom 2
cbo 0
dl 0
loc 125
ccs 0
cts 59
cp 0
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getID_CondoOwner() 0 4 1
A setID_CondoOwner() 0 5 1
A getQuaterName() 0 4 1
A setQuaterName() 0 5 1
A getFromDateWeek() 0 12 3
A setFromDateWeek() 0 5 1
A getToDateWeek() 0 12 3
A setToDateWeek() 0 5 1
1
<?php
2
3
namespace Gueststream\PMS\IQWare\API;
4
5
class ContractSegments
6
{
7
8
    /**
9
     * @var int $ID_CondoOwner
10
     */
11
    protected $ID_CondoOwner = null;
12
13
    /**
14
     * @var string $QuaterName
15
     */
16
    protected $QuaterName = null;
17
18
    /**
19
     * @var \DateTime $FromDateWeek
20
     */
21
    protected $FromDateWeek = null;
22
23
    /**
24
     * @var \DateTime $ToDateWeek
25
     */
26
    protected $ToDateWeek = null;
27
28
    /**
29
     * @param int $ID_CondoOwner
30
     * @param string $QuaterName
31
     * @param \DateTime $FromDateWeek
32
     * @param \DateTime $ToDateWeek
33
     */
34
    public function __construct($ID_CondoOwner, $QuaterName, \DateTime $FromDateWeek, \DateTime $ToDateWeek)
35
    {
36
        $this->ID_CondoOwner = $ID_CondoOwner;
37
        $this->QuaterName = $QuaterName;
38
        $this->FromDateWeek = $FromDateWeek->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $FromDateWeek->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $FromDateWeek.

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...
39
        $this->ToDateWeek = $ToDateWeek->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $ToDateWeek->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $ToDateWeek.

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...
40
    }
41
42
    /**
43
     * @return int
44
     */
45
    public function getID_CondoOwner()
46
    {
47
        return $this->ID_CondoOwner;
48
    }
49
50
    /**
51
     * @param int $ID_CondoOwner
52
     * @return \Gueststream\PMS\IQWare\API\ContractSegments
53
     */
54
    public function setID_CondoOwner($ID_CondoOwner)
55
    {
56
        $this->ID_CondoOwner = $ID_CondoOwner;
57
        return $this;
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function getQuaterName()
64
    {
65
        return $this->QuaterName;
66
    }
67
68
    /**
69
     * @param string $QuaterName
70
     * @return \Gueststream\PMS\IQWare\API\ContractSegments
71
     */
72
    public function setQuaterName($QuaterName)
73
    {
74
        $this->QuaterName = $QuaterName;
75
        return $this;
76
    }
77
78
    /**
79
     * @return \DateTime
80
     */
81
    public function getFromDateWeek()
82
    {
83
        if ($this->FromDateWeek == null) {
84
            return null;
85
        } else {
86
            try {
87
                return new \DateTime($this->FromDateWeek);
88
            } catch (\Exception $e) {
89
                return false;
90
            }
91
        }
92
    }
93
94
    /**
95
     * @param \DateTime $FromDateWeek
96
     * @return \Gueststream\PMS\IQWare\API\ContractSegments
97
     */
98
    public function setFromDateWeek(\DateTime $FromDateWeek)
99
    {
100
        $this->FromDateWeek = $FromDateWeek->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $FromDateWeek->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $FromDateWeek.

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

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...
127
        return $this;
128
    }
129
}
130