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