Completed
Push — master ( da8bf6...ffff83 )
by Tim
27s queued 17s
created

Configuration::setHidden()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * Configuration for time options.
5
 */
6
declare(strict_types=1);
7
8
namespace HDNET\Calendarize\Domain\Model;
9
10
use HDNET\Autoloader\Annotation\DatabaseField;
11
use HDNET\Autoloader\Annotation\DatabaseTable;
12
use HDNET\Autoloader\Annotation\SmartExclude;
13
use HDNET\Calendarize\Utility\DateTimeUtility;
14
15
/**
16
 * Configuration for time options.
17
 *
18
 * @DatabaseTable
19
 * @SmartExclude(excludes={"Language"})
20
 */
21
class Configuration extends AbstractModel implements ConfigurationInterface
22
{
23
    /**
24
     * Type.
25
     *
26
     * @var string
27
     * @DatabaseField("string")
28
     */
29
    protected $type = self::TYPE_TIME;
30
31
    /**
32
     * Handling.
33
     *
34
     * @var string
35
     * @DatabaseField("string")
36
     */
37
    protected $handling = self::HANDLING_INCLUDE;
38
39
    /**
40
     * State.
41
     *
42
     * @var string
43
     * @DatabaseField("string")
44
     */
45
    protected $state = self::STATE_DEFAULT;
46
47
    /**
48
     * Start date.
49
     *
50
     * @var \DateTime|null
51
     * @DatabaseField(type="\DateTime", sql="date default NULL")
52
     */
53
    protected $startDate;
54
55
    /**
56
     * End date.
57
     *
58
     * @var \DateTime|null
59
     * @DatabaseField(type="\DateTime", sql="date default NULL")
60
     */
61
    protected $endDate;
62
63
    /**
64
     * End date dynamic.
65
     *
66
     * @var string
67
     * @DatabaseField("string")
68
     */
69
    protected $endDateDynamic;
70
71
    /**
72
     * Start time.
73
     *
74
     * @var int
75
     * @DatabaseField("int")
76
     */
77
    protected $startTime;
78
79
    /**
80
     * End time.
81
     *
82
     * @var int
83
     * @DatabaseField("int")
84
     */
85
    protected $endTime;
86
87
    /**
88
     * AllDay.
89
     *
90
     * @var bool
91
     * @DatabaseField("bool")
92
     */
93
    protected $allDay;
94
95
    /**
96
     * OpenEndTime.
97
     *
98
     * @var bool
99
     * @DatabaseField("bool")
100
     */
101
    protected $openEndTime;
102
103
    /**
104
     * External ICS url.
105
     *
106
     * @var string
107
     * @DatabaseField("string")
108
     */
109
    protected $externalIcsUrl;
110
111
    /**
112
     * Groups.
113
     *
114
     * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\HDNET\Calendarize\Domain\Model\ConfigurationGroup>
115
     * @DatabaseField("\TYPO3\CMS\Extbase\Persistence\ObjectStorage")
116
     * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy
117
     */
118
    protected $groups;
119
120
    /**
121
     * Frequency.
122
     *
123
     * @var string
124
     * @DatabaseField("string")
125
     */
126
    protected $frequency = self::FREQUENCY_NONE;
127
128
    /**
129
     * Till date.
130
     *
131
     * @var \DateTime|null
132
     * @DatabaseField(type="\DateTime", sql="date default NULL")
133
     */
134
    protected $tillDate;
135
136
    /**
137
     * Till days.
138
     *
139
     * @var int
140
     * @DatabaseField(sql="int(11)")
141
     */
142
    protected $tillDays;
143
144
    /**
145
     * Till days relative.
146
     *
147
     * @var bool
148
     * @DatabaseField("Boolean")
149
     */
150
    protected $tillDaysRelative;
151
152
    /**
153
     * Till days past.
154
     *
155
     * @var int
156
     * @DatabaseField(sql="int(11)")
157
     */
158
    protected $tillDaysPast;
159
160
    /**
161
     * Counter amount.
162
     *
163
     * @var int
164
     * @DatabaseField("int")
165
     */
166
    protected $counterAmount;
167
168
    /**
169
     * Counter interval.
170
     *
171
     * @var int
172
     * @DatabaseField("int")
173
     */
174
    protected $counterInterval;
175
176
    /**
177
     * Recurrence.
178
     *
179
     * @var string
180
     * @DatabaseField("string")
181
     */
182
    protected $recurrence = self::RECURRENCE_NONE;
183
184
    /**
185
     * Day property.
186
     *
187
     * @var string
188
     * @DatabaseField("string")
189
     */
190
    protected $day = self::DAY_NONE;
191
192
    /**
193
     * Import ID if the item is based on an ICS structure.
194
     *
195
     * @var string|null
196
     * @DatabaseField("string")
197
     */
198
    protected $importId;
199
200
    /**
201
     * Hidden.
202
     *
203
     * @var bool
204
     */
205
    protected $hidden = false;
206
207
    /**
208
     * Configuration constructor.
209
     */
210
    public function __construct()
211
    {
212
        $this->groups = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
213
    }
214
215
    /**
216
     * Get type.
217
     *
218
     * @return string
219
     */
220
    public function getType()
221
    {
222
        return $this->type;
223
    }
224
225
    /**
226
     * Set type.
227
     *
228
     * @param string $type
229
     */
230
    public function setType($type)
231
    {
232
        $this->type = $type;
233
    }
234
235
    /**
236
     * Is all day.
237
     *
238
     * @return bool
239
     */
240
    public function isAllDay()
241
    {
242
        return (bool)$this->allDay;
243
    }
244
245
    /**
246
     * Set all day.
247
     *
248
     * @param bool $allDay
249
     */
250
    public function setAllDay($allDay)
251
    {
252
        $this->allDay = (bool)$allDay;
253
    }
254
255
    /**
256
     * Get end date.
257
     *
258
     * @return \DateTime|null
259
     */
260
    public function getEndDate(): ?\DateTime
261
    {
262
        return DateTimeUtility::fixDateTimeForExtbase($this->endDate);
263
    }
264
265
    /**
266
     * Set end date.
267
     *
268
     * @param \DateTime|null $endDate
269
     */
270
    public function setEndDate(?\DateTime $endDate): void
271
    {
272
        $this->endDate = DateTimeUtility::fixDateTimeForDb($endDate);
273
    }
274
275
    /**
276
     * Get end date dynamic.
277
     *
278
     * @return string
279
     */
280
    public function getEndDateDynamic()
281
    {
282
        return $this->endDateDynamic;
283
    }
284
285
    /**
286
     * Set end date dynamic.
287
     *
288
     * @param string $endDateDynamic
289
     */
290
    public function setEndDateDynamic($endDateDynamic)
291
    {
292
        $this->endDateDynamic = $endDateDynamic;
293
    }
294
295
    /**
296
     * Get end time.
297
     *
298
     * @return int
299
     */
300
    public function getEndTime()
301
    {
302
        return $this->endTime;
303
    }
304
305
    /**
306
     * Set end time.
307
     *
308
     * @param int $endTime
309
     */
310
    public function setEndTime($endTime)
311
    {
312
        $this->endTime = $endTime;
313
    }
314
315
    /**
316
     * Get start date.
317
     *
318
     * @return \DateTime|null
319
     */
320
    public function getStartDate(): ?\DateTime
321
    {
322
        return DateTimeUtility::fixDateTimeForExtbase($this->startDate);
323
    }
324
325
    /**
326
     * Set start date.
327
     *
328
     * @param \DateTime|null $startDate
329
     */
330
    public function setStartDate(?\DateTime $startDate): void
331
    {
332
        $this->startDate = DateTimeUtility::fixDateTimeForDb($startDate);
333
    }
334
335
    /**
336
     * Get start time.
337
     *
338
     * @return int
339
     */
340
    public function getStartTime()
341
    {
342
        return $this->startTime;
343
    }
344
345
    /**
346
     * Set start time.
347
     *
348
     * @param int $startTime
349
     */
350
    public function setStartTime($startTime)
351
    {
352
        $this->startTime = $startTime;
353
    }
354
355
    /**
356
     * Get groups.
357
     *
358
     * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
359
     */
360
    public function getGroups()
361
    {
362
        if (null === $this->groups) {
363
            return new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
364
        }
365
366
        return $this->groups;
367
    }
368
369
    /**
370
     * Set groups.
371
     *
372
     * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $groups
373
     */
374
    public function setGroups($groups)
375
    {
376
        $this->groups = $groups;
377
    }
378
379
    /**
380
     * Get frequency.
381
     *
382
     * @return string
383
     */
384
    public function getFrequency()
385
    {
386
        return $this->frequency;
387
    }
388
389
    /**
390
     * Set frequency.
391
     *
392
     * @param string $frequency
393
     */
394
    public function setFrequency($frequency)
395
    {
396
        $this->frequency = $frequency;
397
    }
398
399
    /**
400
     * Get till date.
401
     *
402
     * @return \DateTime|null
403
     */
404
    public function getTillDate(): ?\DateTime
405
    {
406
        return DateTimeUtility::fixDateTimeForExtbase($this->tillDate);
407
    }
408
409
    /**
410
     * Set till date.
411
     *
412
     * @param \DateTime|null $tillDate
413
     */
414
    public function setTillDate(?\DateTime $tillDate): void
415
    {
416
        $this->tillDate = DateTimeUtility::fixDateTimeForDb($tillDate);
417
    }
418
419
    /**
420
     * Get till days.
421
     *
422
     * @return int
423
     */
424
    public function getTillDays()
425
    {
426
        return $this->tillDays;
427
    }
428
429
    /**
430
     * Set till days.
431
     *
432
     * @param int $tillDays
433
     */
434
    public function setTillDays(int $tillDays)
435
    {
436
        $this->tillDays = $tillDays;
437
    }
438
439
    /**
440
     * Is till days relative.
441
     *
442
     * @return bool
443
     */
444
    public function isTillDaysRelative()
445
    {
446
        return $this->tillDaysRelative;
447
    }
448
449
    /**
450
     * Set till days relative.
451
     *
452
     * @param bool $tillDaysRelative
453
     */
454
    public function setTillDaysRelative(bool $tillDaysRelative)
455
    {
456
        $this->tillDaysRelative = $tillDaysRelative;
457
    }
458
459
    /**
460
     * Get till days past.
461
     *
462
     * @return int
463
     */
464
    public function getTillDaysPast()
465
    {
466
        return $this->tillDaysPast;
467
    }
468
469
    /**
470
     * Set till days past.
471
     *
472
     * @param int $tillDaysPast
473
     */
474
    public function setTillDaysPast(int $tillDaysPast)
475
    {
476
        $this->tillDaysPast = $tillDaysPast;
477
    }
478
479
    /**
480
     * Get counter amount.
481
     *
482
     * @return int
483
     */
484
    public function getCounterAmount()
485
    {
486
        return $this->counterAmount;
487
    }
488
489
    /**
490
     * Set counter amount.
491
     *
492
     * @param int $counterAmount
493
     */
494
    public function setCounterAmount($counterAmount)
495
    {
496
        $this->counterAmount = $counterAmount;
497
    }
498
499
    /**
500
     * Get counter interval.
501
     *
502
     * @return int
503
     */
504
    public function getCounterInterval()
505
    {
506
        return $this->counterInterval;
507
    }
508
509
    /**
510
     * Set counter interval.
511
     *
512
     * @param int $counterInterval
513
     */
514
    public function setCounterInterval($counterInterval)
515
    {
516
        $this->counterInterval = $counterInterval;
517
    }
518
519
    /**
520
     * Get external ICS URL.
521
     *
522
     * @return string
523
     */
524
    public function getExternalIcsUrl()
525
    {
526
        return $this->externalIcsUrl;
527
    }
528
529
    /**
530
     * Set external ICS URL.
531
     *
532
     * @param string $externalIcsUrl
533
     */
534
    public function setExternalIcsUrl($externalIcsUrl)
535
    {
536
        $this->externalIcsUrl = $externalIcsUrl;
537
    }
538
539
    /**
540
     * Get day.
541
     *
542
     * @return string
543
     */
544
    public function getDay()
545
    {
546
        return $this->day;
547
    }
548
549
    /**
550
     * Set day.
551
     *
552
     * @param string $day
553
     */
554
    public function setDay($day)
555
    {
556
        $this->day = $day;
557
    }
558
559
    /**
560
     * Get recurrence.
561
     *
562
     * @return string
563
     */
564
    public function getRecurrence()
565
    {
566
        return $this->recurrence;
567
    }
568
569
    /**
570
     * Set recurrence.
571
     *
572
     * @param string $recurrence
573
     */
574
    public function setRecurrence($recurrence)
575
    {
576
        $this->recurrence = $recurrence;
577
    }
578
579
    /**
580
     * Get handling.
581
     *
582
     * @return string
583
     */
584
    public function getHandling()
585
    {
586
        return $this->handling;
587
    }
588
589
    /**
590
     * Set handling.
591
     *
592
     * @param string $handling
593
     */
594
    public function setHandling($handling)
595
    {
596
        $this->handling = $handling;
597
    }
598
599
    /**
600
     * Get state.
601
     *
602
     * @return string
603
     */
604
    public function getState()
605
    {
606
        return trim($this->state);
607
    }
608
609
    /**
610
     * Set state.
611
     *
612
     * @param string $state
613
     */
614
    public function setState($state)
615
    {
616
        $this->state = $state;
617
    }
618
619
    /**
620
     * @return bool
621
     */
622
    public function isOpenEndTime()
623
    {
624
        return (bool)$this->openEndTime;
625
    }
626
627
    /**
628
     * @param bool $openEndTime
629
     */
630
    public function setOpenEndTime(bool $openEndTime)
631
    {
632
        $this->openEndTime = $openEndTime;
633
    }
634
635
    /**
636
     * @return string|null
637
     */
638
    public function getImportId(): ?string
639
    {
640
        return $this->importId;
641
    }
642
643
    /**
644
     * @param string|null $importId
645
     */
646
    public function setImportId(?string $importId): void
647
    {
648
        $this->importId = $importId;
649
    }
650
651
    /**
652
     * @return bool
653
     */
654
    public function isHidden(): bool
655
    {
656
        return $this->hidden;
657
    }
658
659
    /**
660
     * @param bool $hidden
661
     */
662
    public function setHidden(bool $hidden): void
663
    {
664
        $this->hidden = $hidden;
665
    }
666
}
667