Completed
Pull Request — master (#194)
by
unknown
03:02
created

Configuration::getStartTime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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