Completed
Push — master ( 520c8e...7c36f5 )
by Tim
10:13
created

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