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