Completed
Push — master ( 13633f...2513f1 )
by Joachim
15:06
created

Period   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 154
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 12
dl 0
loc 154
c 0
b 0
f 0
rs 10

12 Methods

Rating   Name   Duplication   Size   Complexity  
A setId() 0 4 1
A setEndDate() 0 4 1
A setTitle() 0 4 1
A getEndDate() 0 3 1
A getStartDate() 0 3 1
A getTitle() 0 3 1
A getDisabled() 0 3 1
A setStartDate() 0 4 1
A setExternalId() 0 4 1
A setDisabled() 0 4 1
A getExternalId() 0 3 1
A getId() 0 3 1
1
<?php
2
3
namespace Loevgaard\DandomainFoundation\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Loevgaard\DandomainFoundation\Entity\Generated\PeriodInterface;
7
use Loevgaard\DandomainFoundation\Entity\Generated\PeriodTrait;
8
9
/**
10
 * @ORM\Entity()
11
 * @ORM\Table(name="loevgaard_dandomain_periods")
12
 */
13
class Period implements PeriodInterface
14
{
15
    use PeriodTrait;
16
17
    /**
18
     * @var int
19
     *
20
     * @ORM\Id
21
     * @ORM\GeneratedValue
22
     * @ORM\Column(type="integer")
23
     **/
24
    protected $id;
25
26
    /**
27
     * @var int
28
     *
29
     * @ORM\Column(type="string", unique=true)
30
     */
31
    protected $externalId;
32
33
    /**
34
     * @var bool|null
35
     *
36
     * @ORM\Column(nullable=true, type="boolean")
37
     */
38
    protected $disabled;
39
40
    /**
41
     * @var \DateTimeImmutable|null
42
     *
43
     * @ORM\Column(nullable=true, type="datetime_immutable")
44
     */
45
    protected $endDate;
46
47
    /**
48
     * @var \DateTimeImmutable|null
49
     *
50
     * @ORM\Column(nullable=true, type="datetime_immutable")
51
     */
52
    protected $startDate;
53
54
    /**
55
     * @var string|null
56
     *
57
     * @ORM\Column(nullable=true, type="string", length=191)
58
     */
59
    protected $title;
60
61
    /**
62
     * @return int
63
     */
64
    public function getId(): int
65
    {
66
        return (int)$this->id;
67
    }
68
69
    /**
70
     * @param int $id
71
     * @return Period
72
     */
73
    public function setId(int $id)
74
    {
75
        $this->id = $id;
76
        return $this;
77
    }
78
79
    /**
80
     * @return int
81
     */
82
    public function getExternalId(): int
83
    {
84
        return $this->externalId;
85
    }
86
87
    /**
88
     * @param int $externalId
89
     * @return Period
90
     */
91
    public function setExternalId(int $externalId)
92
    {
93
        $this->externalId = $externalId;
94
        return $this;
95
    }
96
97
    /**
98
     * @return bool|null
99
     */
100
    public function getDisabled()
101
    {
102
        return $this->disabled;
103
    }
104
105
    /**
106
     * @param bool|null $disabled
107
     * @return Period
108
     */
109
    public function setDisabled($disabled)
110
    {
111
        $this->disabled = $disabled;
112
        return $this;
113
    }
114
115
    /**
116
     * @return \DateTimeImmutable|null
117
     */
118
    public function getEndDate()
119
    {
120
        return $this->endDate;
121
    }
122
123
    /**
124
     * @param \DateTimeImmutable|null $endDate
125
     * @return Period
126
     */
127
    public function setEndDate($endDate)
128
    {
129
        $this->endDate = $endDate;
130
        return $this;
131
    }
132
133
    /**
134
     * @return \DateTimeImmutable|null
135
     */
136
    public function getStartDate()
137
    {
138
        return $this->startDate;
139
    }
140
141
    /**
142
     * @param \DateTimeImmutable|null $startDate
143
     * @return Period
144
     */
145
    public function setStartDate($startDate)
146
    {
147
        $this->startDate = $startDate;
148
        return $this;
149
    }
150
151
    /**
152
     * @return null|string
153
     */
154
    public function getTitle()
155
    {
156
        return $this->title;
157
    }
158
159
    /**
160
     * @param null|string $title
161
     * @return Period
162
     */
163
    public function setTitle($title)
164
    {
165
        $this->title = $title;
166
        return $this;
167
    }
168
}
169