Completed
Push — master ( 73775f...ca6828 )
by Tim
01:53
created

Configuration::setOpenEndTime()   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\Calendarize\Utility\DateTimeUtility;
11
12
/**
13
 * Configuration for time options.
14
 *
15
 * @db
16
 * @smartExclude Language
17
 */
18
class Configuration extends AbstractModel implements ConfigurationInterface
19
{
20
    /**
21
     * Type.
22
     *
23
     * @var string
24
     * @db
25
     */
26
    protected $type = self::TYPE_TIME;
27
28
    /**
29
     * Handling.
30
     *
31
     * @var string
32
     * @db
33
     */
34
    protected $handling = self::HANDLING_INCLUDE;
35
36
    /**
37
     * State.
38
     *
39
     * @var string
40
     * @db
41
     */
42
    protected $state = self::STATE_DEFAULT;
43
44
    /**
45
     * Start date.
46
     *
47
     * @var \DateTime
48
     * @db
49
     */
50
    protected $startDate;
51
52
    /**
53
     * End date.
54
     *
55
     * @var \DateTime
56
     * @db
57
     */
58
    protected $endDate;
59
60
    /**
61
     * End date dynamic.
62
     *
63
     * @var string
64
     * @db
65
     */
66
    protected $endDateDynamic;
67
68
    /**
69
     * Start time.
70
     *
71
     * @var int
72
     * @db
73
     */
74
    protected $startTime;
75
76
    /**
77
     * End time.
78
     *
79
     * @var int
80
     * @db
81
     */
82
    protected $endTime;
83
84
    /**
85
     * AllDay.
86
     *
87
     * @var bool
88
     * @db
89
     */
90
    protected $allDay;
91
92
    /**
93
     * OpenEndTime.
94
     *
95
     * @var bool
96
     * @db
97
     */
98
    protected $openEndTime;
99
100
    /**
101
     * External ICS url.
102
     *
103
     * @var string
104
     * @db
105
     */
106
    protected $externalIcsUrl;
107
108
    /**
109
     * Groups.
110
     *
111
     * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\HDNET\Calendarize\Domain\Model\ConfigurationGroup>
112
     * @db text
113
     * @lazy
114
     * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy
115
     */
116
    protected $groups;
117
118
    /**
119
     * Frequency.
120
     *
121
     * @var string
122
     * @db
123
     */
124
    protected $frequency = self::FREQUENCY_NONE;
125
126
    /**
127
     * Till date.
128
     *
129
     * @var \DateTime
130
     * @db
131
     */
132
    protected $tillDate;
133
134
    /**
135
     * Counter amount.
136
     *
137
     * @var int
138
     * @db
139
     */
140
    protected $counterAmount;
141
142
    /**
143
     * Counter interval.
144
     *
145
     * @var int
146
     * @db
147
     */
148
    protected $counterInterval;
149
150
    /**
151
     * Recurrence.
152
     *
153
     * @var string
154
     * @db
155
     */
156
    protected $recurrence = self::RECURRENCE_NONE;
157
158
    /**
159
     * Day property.
160
     *
161
     * @var string
162
     * @db
163
     */
164
    protected $day = self::DAY_NONE;
165
166
    /**
167
     * Import ID if the item is based on an ICS structure.
168
     *
169
     * @var string
170
     * @db
171
     */
172
    protected $importId;
173
174
    /**
175
     * Configuration constructor.
176
     */
177
    public function __construct()
178
    {
179
        $this->groups = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
180
    }
181
182
    /**
183
     * Get type.
184
     *
185
     * @return string
186
     */
187
    public function getType()
188
    {
189
        return $this->type;
190
    }
191
192
    /**
193
     * Set type.
194
     *
195
     * @param string $type
196
     */
197
    public function setType($type)
198
    {
199
        $this->type = $type;
200
    }
201
202
    /**
203
     * Is all day.
204
     *
205
     * @return bool
206
     */
207
    public function isAllDay()
208
    {
209
        return (bool) $this->allDay;
210
    }
211
212
    /**
213
     * Set all day.
214
     *
215
     * @param bool $allDay
216
     */
217
    public function setAllDay($allDay)
218
    {
219
        $this->allDay = (bool) $allDay;
220
    }
221
222
    /**
223
     * Get end date.
224
     *
225
     * @return \DateTime
226
     */
227
    public function getEndDate()
228
    {
229
        if ($this->endDate instanceof \DateTime) {
230
            $this->endDate->setTimezone(DateTimeUtility::getTimeZone());
231
        }
232
233
        return $this->endDate;
234
    }
235
236
    /**
237
     * Set end date.
238
     *
239
     * @param \DateTime $endDate
240
     */
241
    public function setEndDate($endDate)
242
    {
243
        $this->endDate = $endDate;
244
    }
245
246
    /**
247
     * Get end date dynamic.
248
     *
249
     * @return string
250
     */
251
    public function getEndDateDynamic()
252
    {
253
        return $this->endDateDynamic;
254
    }
255
256
    /**
257
     * Set end date dynamic.
258
     *
259
     * @param string $endDateDynamic
260
     */
261
    public function setEndDateDynamic($endDateDynamic)
262
    {
263
        $this->endDateDynamic = $endDateDynamic;
264
    }
265
266
    /**
267
     * Get end time.
268
     *
269
     * @return int
270
     */
271
    public function getEndTime()
272
    {
273
        return $this->endTime;
274
    }
275
276
    /**
277
     * Set end time.
278
     *
279
     * @param int $endTime
280
     */
281
    public function setEndTime($endTime)
282
    {
283
        $this->endTime = $endTime;
284
    }
285
286
    /**
287
     * Get start date.
288
     *
289
     * @return \DateTime
290
     */
291
    public function getStartDate()
292
    {
293
        if ($this->startDate instanceof \DateTime) {
294
            $this->startDate->setTimezone(DateTimeUtility::getTimeZone());
295
        }
296
297
        return $this->startDate;
298
    }
299
300
    /**
301
     * Set start date.
302
     *
303
     * @param \DateTime $startDate
304
     */
305
    public function setStartDate($startDate)
306
    {
307
        $this->startDate = $startDate;
308
    }
309
310
    /**
311
     * Get start time.
312
     *
313
     * @return int
314
     */
315
    public function getStartTime()
316
    {
317
        return $this->startTime;
318
    }
319
320
    /**
321
     * Set start time.
322
     *
323
     * @param int $startTime
324
     */
325
    public function setStartTime($startTime)
326
    {
327
        $this->startTime = $startTime;
328
    }
329
330
    /**
331
     * Get groups.
332
     *
333
     * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
334
     */
335
    public function getGroups()
336
    {
337
        if (null === $this->groups) {
338
            return new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
339
        }
340
341
        return $this->groups;
342
    }
343
344
    /**
345
     * Set groups.
346
     *
347
     * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $groups
348
     */
349
    public function setGroups($groups)
350
    {
351
        $this->groups = $groups;
352
    }
353
354
    /**
355
     * Get frequency.
356
     *
357
     * @return string
358
     */
359
    public function getFrequency()
360
    {
361
        return $this->frequency;
362
    }
363
364
    /**
365
     * Set frequency.
366
     *
367
     * @param string $frequency
368
     */
369
    public function setFrequency($frequency)
370
    {
371
        $this->frequency = $frequency;
372
    }
373
374
    /**
375
     * Get till date.
376
     *
377
     * @return \DateTime
378
     */
379
    public function getTillDate()
380
    {
381
        return $this->tillDate;
382
    }
383
384
    /**
385
     * Set till date.
386
     *
387
     * @param \DateTime $tillDate
388
     */
389
    public function setTillDate($tillDate)
390
    {
391
        $this->tillDate = $tillDate;
392
    }
393
394
    /**
395
     * Get counter amount.
396
     *
397
     * @return int
398
     */
399
    public function getCounterAmount()
400
    {
401
        return $this->counterAmount;
402
    }
403
404
    /**
405
     * Set counter amount.
406
     *
407
     * @param int $counterAmount
408
     */
409
    public function setCounterAmount($counterAmount)
410
    {
411
        $this->counterAmount = $counterAmount;
412
    }
413
414
    /**
415
     * Get counter interval.
416
     *
417
     * @return int
418
     */
419
    public function getCounterInterval()
420
    {
421
        return $this->counterInterval;
422
    }
423
424
    /**
425
     * Set counter interval.
426
     *
427
     * @param int $counterInterval
428
     */
429
    public function setCounterInterval($counterInterval)
430
    {
431
        $this->counterInterval = $counterInterval;
432
    }
433
434
    /**
435
     * Get external ICS URL.
436
     *
437
     * @return string
438
     */
439
    public function getExternalIcsUrl()
440
    {
441
        return $this->externalIcsUrl;
442
    }
443
444
    /**
445
     * Set external ICS URL.
446
     *
447
     * @param string $externalIcsUrl
448
     */
449
    public function setExternalIcsUrl($externalIcsUrl)
450
    {
451
        $this->externalIcsUrl = $externalIcsUrl;
452
    }
453
454
    /**
455
     * Get day.
456
     *
457
     * @return string
458
     */
459
    public function getDay()
460
    {
461
        return $this->day;
462
    }
463
464
    /**
465
     * Set day.
466
     *
467
     * @param string $day
468
     */
469
    public function setDay($day)
470
    {
471
        $this->day = $day;
472
    }
473
474
    /**
475
     * Get recurrence.
476
     *
477
     * @return string
478
     */
479
    public function getRecurrence()
480
    {
481
        return $this->recurrence;
482
    }
483
484
    /**
485
     * Set recurrence.
486
     *
487
     * @param string $recurrence
488
     */
489
    public function setRecurrence($recurrence)
490
    {
491
        $this->recurrence = $recurrence;
492
    }
493
494
    /**
495
     * Get handling.
496
     *
497
     * @return string
498
     */
499
    public function getHandling()
500
    {
501
        return $this->handling;
502
    }
503
504
    /**
505
     * Set handling.
506
     *
507
     * @param string $handling
508
     */
509
    public function setHandling($handling)
510
    {
511
        $this->handling = $handling;
512
    }
513
514
    /**
515
     * Get state.
516
     *
517
     * @return string
518
     */
519
    public function getState()
520
    {
521
        return \trim($this->state);
522
    }
523
524
    /**
525
     * Set state.
526
     *
527
     * @param string $state
528
     */
529
    public function setState($state)
530
    {
531
        $this->state = $state;
532
    }
533
534
    /**
535
     * @return bool
536
     */
537
    public function isOpenEndTime()
538
    {
539
        return $this->openEndTime;
540
    }
541
542
    /**
543
     * @param bool $openEndTime
544
     */
545
    public function setOpenEndTime(bool $openEndTime)
546
    {
547
        $this->openEndTime = $openEndTime;
548
    }
549
550
}
551