Passed
Push — master ( b06e84...c11729 )
by Florian
01:48
created

Event::setShowInCalender()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the vseth-semesterly-reports project.
5
 *
6
 * (c) Florian Moser <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace App\Entity;
13
14
use App\Entity\Base\BaseEntity;
15
use App\Entity\Traits\IdTrait;
16
use App\Form\Type\SemesterType;
17
use Doctrine\ORM\Mapping as ORM;
18
19
/**
20
 * an event determines how the questionnaire looks like.
21
 *
22
 * @ORM\Entity()
23
 * @ORM\HasLifecycleCallbacks
24
 */
25
class Event extends BaseEntity
26
{
27
    use IdTrait;
28
29
    /**
30
     * @var int
31
     *
32
     * @ORM\Column(type="integer")
33
     */
34
    private $semester;
35
36
    /**
37
     * @var string|null
38
     *
39
     * @ORM\Column(type="text", nullable=true)
40
     */
41
    private $nameDe;
42
43
    /**
44
     * @var string|null
45
     *
46
     * @ORM\Column(type="text", nullable=true)
47
     */
48
    private $nameEn;
49
50
    /**
51
     * @var string|null
52
     *
53
     * @ORM\Column(type="text", nullable=true)
54
     */
55
    private $descriptionDe;
56
57
    /**
58
     * @var string|null
59
     *
60
     * @ORM\Column(type="text", nullable=true)
61
     */
62
    private $descriptionEn;
63
64
    /**
65
     * @var string
66
     *
67
     * @ORM\Column(type="text")
68
     */
69
    private $location;
70
71
    /**
72
     * @var \DateTime|null
73
     *
74
     * @ORM\Column(type="datetime", nullable=true)
75
     */
76
    private $startDate;
77
78
    /**
79
     * @var \DateTime|null
80
     *
81
     * @ORM\Column(type="datetime", nullable=true)
82
     */
83
    private $endDate;
84
85
    /**
86
     * @var bool
87
     *
88
     * @ORM\Column(type="boolean", options={"default": true})
89
     */
90
    private $showInCalender = true;
91
92
    /**
93
     * @var int
94
     *
95
     * @ORM\Column(type="integer")
96
     */
97
    private $budget;
98
99
    /**
100
     * @var bool
101
     *
102
     * @ORM\Column(type="boolean")
103
     */
104
    private $needFinancialSupport;
105
106
    /**
107
     * @var Organisation
108
     *
109
     * @ORM\ManyToOne(targetEntity="App\Entity\Organisation", inversedBy="events")
110
     */
111
    private $organisation;
112
113
    public function getSemester(): int
114
    {
115
        return $this->semester;
116
    }
117
118
    /**
119
     * @return int
120
     */
121
    public function getSemesterName(): string
122
    {
123
        return SemesterType::semesterToString($this->getSemester());
0 ignored issues
show
Bug Best Practice introduced by
The expression return App\Form\Type\Sem...g($this->getSemester()) returns the type string which is incompatible with the documented return type integer.
Loading history...
124
    }
125
126
    public function setSemester(int $semester): void
127
    {
128
        $this->semester = $semester;
129
    }
130
131
    /**
132
     * @return string|null
133
     */
134
    public function getName()
135
    {
136
        return $this->getNameDe() !== null ? $this->getNameDe() : $this->getNameEn();
137
    }
138
139
    public function getNameDe(): ?string
140
    {
141
        return $this->nameDe;
142
    }
143
144
    public function setNameDe(?string $nameDe): void
145
    {
146
        $this->nameDe = $nameDe;
147
    }
148
149
    public function getNameEn(): ?string
150
    {
151
        return $this->nameEn;
152
    }
153
154
    public function setNameEn(?string $nameEn): void
155
    {
156
        $this->nameEn = $nameEn;
157
    }
158
159
    /**
160
     * @return string|null
161
     */
162
    public function getDescription()
163
    {
164
        return $this->getDescriptionDe() !== null ? $this->getDescriptionDe() : $this->getDescriptionEn();
165
    }
166
167
    public function getDescriptionDe(): ?string
168
    {
169
        return $this->descriptionDe;
170
    }
171
172
    public function setDescriptionDe(?string $descriptionDe): void
173
    {
174
        $this->descriptionDe = $descriptionDe;
175
    }
176
177
    public function getDescriptionEn(): ?string
178
    {
179
        return $this->descriptionEn;
180
    }
181
182
    public function setDescriptionEn(?string $descriptionEn): void
183
    {
184
        $this->descriptionEn = $descriptionEn;
185
    }
186
187
    public function getLocation(): string
188
    {
189
        return $this->location;
190
    }
191
192
    public function setLocation(string $location): void
193
    {
194
        $this->location = $location;
195
    }
196
197
    public function getStartDate(): ?\DateTime
198
    {
199
        return $this->startDate;
200
    }
201
202
    public function setStartDate(?\DateTime $startDate): void
203
    {
204
        $this->startDate = $startDate;
205
    }
206
207
    public function getEndDate(): ?\DateTime
208
    {
209
        return $this->endDate;
210
    }
211
212
    public function setEndDate(?\DateTime $endDate): void
213
    {
214
        $this->endDate = $endDate;
215
    }
216
217
    public function getBudget(): int
218
    {
219
        return $this->budget;
220
    }
221
222
    public function setBudget(int $budget): void
223
    {
224
        $this->budget = $budget;
225
    }
226
227
    public function isNeedFinancialSupport(): bool
228
    {
229
        return $this->needFinancialSupport;
230
    }
231
232
    public function setNeedFinancialSupport(bool $needFinancialSupport): void
233
    {
234
        $this->needFinancialSupport = $needFinancialSupport;
235
    }
236
237
    public function getOrganisation(): Organisation
238
    {
239
        return $this->organisation;
240
    }
241
242
    public function setOrganisation(Organisation $organisation): void
243
    {
244
        $this->organisation = $organisation;
245
    }
246
247
    public function getShowInCalender(): bool
248
    {
249
        return $this->showInCalender;
250
    }
251
252
    public function setShowInCalender(bool $showInCalender): void
253
    {
254
        $this->showInCalender = $showInCalender;
255
    }
256
}
257