Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 63
0.00% covered (danger)
0.00%
0 / 57
CRAP
0.00% covered (danger)
0.00%
0 / 1
Termin
0.00% covered (danger)
0.00%
0 / 63
0.00% covered (danger)
0.00%
0 / 57
3660
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getFromTemplate
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setFromTemplate
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getStartDate
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setStartDate
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getStartTime
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setStartTime
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getEndDate
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setEndDate
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getEndTime
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setEndTime
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDeadline
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setDeadline
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getShouldPromote
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setShouldPromote
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getTitle
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setTitle
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getText
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setText
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getLabels
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 addLabel
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 removeLabel
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 clearLabels
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSolvId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setSolvId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getGo2olId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setGo2olId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getCoordinateX
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setCoordinateX
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getCoordinateY
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setCoordinateY
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getLocation
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setLocation
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getNewsletter
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setNewsletter
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getImageIds
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
12
 setImageIds
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
 getParticipantsRegistration
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setParticipantsRegistration
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getNumParticipants
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setNumParticipants
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getMinParticipants
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setMinParticipants
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getMaxParticipants
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setMaxParticipants
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getVolunteersRegistration
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setVolunteersRegistration
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getNumVolunteers
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setNumVolunteers
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getMinVolunteers
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setMinVolunteers
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getMaxVolunteers
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setMaxVolunteers
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getEntityNameForStorage
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getEntityIdForStorage
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace Olz\Entity\Termine;
4
5use Doctrine\Common\Collections\ArrayCollection;
6use Doctrine\Common\Collections\Collection;
7use Doctrine\ORM\Mapping as ORM;
8use Olz\Entity\Anmelden\Registration;
9use Olz\Entity\Common\DataStorageInterface;
10use Olz\Entity\Common\DataStorageTrait;
11use Olz\Entity\Common\OlzEntity;
12use Olz\Repository\Termine\TerminRepository;
13
14#[ORM\Table(name: 'termine')]
15#[ORM\Index(name: 'start_date_on_off_index', columns: ['start_date', 'on_off'])]
16#[ORM\Entity(repositoryClass: TerminRepository::class)]
17class Termin extends OlzEntity implements DataStorageInterface {
18    use DataStorageTrait;
19
20    #[ORM\Id]
21    #[ORM\Column(type: 'integer', nullable: false)]
22    #[ORM\GeneratedValue]
23    private int $id;
24
25    #[ORM\ManyToOne(targetEntity: TerminTemplate::class)]
26    #[ORM\JoinColumn(name: 'from_template_id', referencedColumnName: 'id')]
27    private ?TerminTemplate $from_template;
28
29    #[ORM\Column(type: 'date', nullable: false)]
30    private \DateTime $start_date;
31
32    #[ORM\Column(type: 'time', nullable: true)]
33    private ?\DateTime $start_time;
34
35    #[ORM\Column(type: 'date', nullable: true)]
36    private ?\DateTime $end_date;
37
38    #[ORM\Column(type: 'time', nullable: true)]
39    private ?\DateTime $end_time;
40
41    #[ORM\Column(type: 'datetime', nullable: true)]
42    private ?\DateTime $deadline;
43
44    #[ORM\Column(type: 'boolean', nullable: false, options: ['default' => 0])]
45    private bool $should_promote;
46
47    #[ORM\ManyToOne(targetEntity: Registration::class)]
48    #[ORM\JoinColumn(name: 'participants_registration_id', referencedColumnName: 'id')]
49    private ?Registration $participants_registration;
50
51    #[ORM\Column(type: 'integer', nullable: true)]
52    private ?int $num_participants;
53
54    #[ORM\Column(type: 'integer', nullable: true)]
55    private ?int $min_participants;
56
57    #[ORM\Column(type: 'integer', nullable: true)]
58    private ?int $max_participants;
59
60    #[ORM\ManyToOne(targetEntity: Registration::class)]
61    #[ORM\JoinColumn(name: 'volunteers_registration_id', referencedColumnName: 'id')]
62    private ?Registration $volunteers_registration;
63
64    #[ORM\Column(type: 'integer', nullable: true)]
65    private ?int $num_volunteers;
66
67    #[ORM\Column(type: 'integer', nullable: true)]
68    private ?int $min_volunteers;
69
70    #[ORM\Column(type: 'integer', nullable: true)]
71    private ?int $max_volunteers;
72
73    #[ORM\Column(type: 'boolean', nullable: false, options: ['default' => 0])]
74    private bool $newsletter;
75
76    #[ORM\Column(type: 'text', nullable: true)]
77    private ?string $title;
78
79    #[ORM\Column(type: 'text', nullable: true)]
80    private ?string $go2ol;
81
82    #[ORM\Column(type: 'text', nullable: true)]
83    private ?string $text;
84
85    /** @var Collection<int|string, TerminLabel>&iterable<TerminLabel> */
86    #[ORM\JoinTable(name: 'termin_label_map')]
87    #[ORM\JoinColumn(name: 'termin_id', referencedColumnName: 'id')]
88    #[ORM\InverseJoinColumn(name: 'label_id', referencedColumnName: 'id')]
89    #[ORM\ManyToMany(targetEntity: TerminLabel::class, inversedBy: 'termine')]
90    private Collection $labels;
91
92    #[ORM\ManyToOne(targetEntity: TerminLocation::class)]
93    #[ORM\JoinColumn(name: 'location_id', referencedColumnName: 'id', nullable: true)]
94    private ?TerminLocation $location;
95
96    #[ORM\Column(type: 'integer', nullable: true)]
97    private ?int $xkoord;
98
99    #[ORM\Column(type: 'integer', nullable: true)]
100    private ?int $ykoord;
101
102    #[ORM\Column(type: 'integer', nullable: true)]
103    private ?int $solv_uid;
104
105    #[ORM\Column(type: 'text', nullable: true)]
106    private ?string $image_ids;
107
108    // PRIMARY KEY (`id`),
109    // KEY `datum` (`datum`),
110    // KEY `on_off` (`on_off`),
111    // KEY `datum_end` (`datum_end`),
112    // KEY `datum_off` (`datum_off`)
113
114    public function __construct() {
115        $this->labels = new ArrayCollection();
116    }
117
118    public function getId(): ?int {
119        return $this->id ?? null;
120    }
121
122    public function setId(int $new_value): void {
123        $this->id = $new_value;
124    }
125
126    public function getFromTemplate(): ?TerminTemplate {
127        return $this->from_template;
128    }
129
130    public function setFromTemplate(?TerminTemplate $new_value): void {
131        $this->from_template = $new_value;
132    }
133
134    public function getStartDate(): \DateTime {
135        return $this->start_date;
136    }
137
138    public function setStartDate(\DateTime $new_value): void {
139        $this->start_date = $new_value;
140    }
141
142    public function getStartTime(): ?\DateTime {
143        return $this->start_time;
144    }
145
146    public function setStartTime(?\DateTime $new_value): void {
147        $this->start_time = $new_value;
148    }
149
150    public function getEndDate(): ?\DateTime {
151        return $this->end_date;
152    }
153
154    public function setEndDate(?\DateTime $new_value): void {
155        $this->end_date = $new_value;
156    }
157
158    public function getEndTime(): ?\DateTime {
159        return $this->end_time;
160    }
161
162    public function setEndTime(?\DateTime $new_value): void {
163        $this->end_time = $new_value;
164    }
165
166    public function getDeadline(): ?\DateTime {
167        return $this->deadline;
168    }
169
170    public function setDeadline(?\DateTime $new_value): void {
171        $this->deadline = $new_value;
172    }
173
174    public function getShouldPromote(): bool {
175        return $this->should_promote;
176    }
177
178    public function setShouldPromote(bool $new_value): void {
179        $this->should_promote = $new_value;
180    }
181
182    public function getTitle(): ?string {
183        return $this->title;
184    }
185
186    public function setTitle(?string $new_value): void {
187        $this->title = $new_value;
188    }
189
190    public function getText(): ?string {
191        return $this->text;
192    }
193
194    public function setText(?string $new_value): void {
195        $this->text = $new_value;
196    }
197
198    /** @return Collection<int|string, TerminLabel>&iterable<TerminLabel> */
199    public function getLabels(): Collection {
200        return $this->labels;
201    }
202
203    public function addLabel(TerminLabel $label): void {
204        $this->labels->add($label);
205    }
206
207    public function removeLabel(TerminLabel $label): void {
208        $this->labels->removeElement($label);
209    }
210
211    public function clearLabels(): void {
212        $this->labels->clear();
213    }
214
215    public function getSolvId(): ?int {
216        return $this->solv_uid;
217    }
218
219    public function setSolvId(?int $new_value): void {
220        $this->solv_uid = $new_value;
221    }
222
223    // @deprecated Use SolvId to get the go2ol (or other platform) ID
224    public function getGo2olId(): ?string {
225        return $this->go2ol;
226    }
227
228    // @deprecated Use SolvId to get the go2ol (or other platform) ID
229    public function setGo2olId(?string $new_value): void {
230        $this->go2ol = $new_value;
231    }
232
233    public function getCoordinateX(): ?int {
234        return $this->xkoord;
235    }
236
237    public function setCoordinateX(?int $new_value): void {
238        $this->xkoord = $new_value;
239    }
240
241    public function getCoordinateY(): ?int {
242        return $this->ykoord;
243    }
244
245    public function setCoordinateY(?int $new_value): void {
246        $this->ykoord = $new_value;
247    }
248
249    public function getLocation(): ?TerminLocation {
250        return $this->location;
251    }
252
253    public function setLocation(?TerminLocation $new_value): void {
254        $this->location = $new_value;
255    }
256
257    public function getNewsletter(): bool {
258        return $this->newsletter;
259    }
260
261    public function setNewsletter(bool $new_value): void {
262        $this->newsletter = $new_value;
263    }
264
265    /** @return array<string> */
266    public function getImageIds(): array {
267        if ($this->image_ids == null) {
268            return [];
269        }
270        $array = json_decode($this->image_ids, true);
271        return is_array($array) ? $array : [];
272    }
273
274    /** @param array<string> $new_value */
275    public function setImageIds(array $new_value): void {
276        $enc_value = json_encode($new_value);
277        if (!$enc_value) {
278            return;
279        }
280        $this->image_ids = $enc_value;
281    }
282
283    public function getParticipantsRegistration(): ?Registration {
284        return $this->participants_registration;
285    }
286
287    public function setParticipantsRegistration(?Registration $new_value): void {
288        $this->participants_registration = $new_value;
289    }
290
291    public function getNumParticipants(): ?int {
292        return $this->num_participants;
293    }
294
295    public function setNumParticipants(?int $new_value): void {
296        $this->num_participants = $new_value;
297    }
298
299    public function getMinParticipants(): ?int {
300        return $this->min_participants;
301    }
302
303    public function setMinParticipants(?int $new_value): void {
304        $this->min_participants = $new_value;
305    }
306
307    public function getMaxParticipants(): ?int {
308        return $this->max_participants;
309    }
310
311    public function setMaxParticipants(?int $new_value): void {
312        $this->max_participants = $new_value;
313    }
314
315    public function getVolunteersRegistration(): ?Registration {
316        return $this->volunteers_registration;
317    }
318
319    public function setVolunteersRegistration(?Registration $new_value): void {
320        $this->volunteers_registration = $new_value;
321    }
322
323    public function getNumVolunteers(): ?int {
324        return $this->num_volunteers;
325    }
326
327    public function setNumVolunteers(?int $new_value): void {
328        $this->num_volunteers = $new_value;
329    }
330
331    public function getMinVolunteers(): ?int {
332        return $this->min_volunteers;
333    }
334
335    public function setMinVolunteers(?int $new_value): void {
336        $this->min_volunteers = $new_value;
337    }
338
339    public function getMaxVolunteers(): ?int {
340        return $this->max_volunteers;
341    }
342
343    public function setMaxVolunteers(?int $new_value): void {
344        $this->max_volunteers = $new_value;
345    }
346
347    // ---
348
349    public static function getEntityNameForStorage(): string {
350        return 'termine';
351    }
352
353    public function getEntityIdForStorage(): string {
354        return "{$this->getId()}";
355    }
356}