ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
VJournal.php
Go to the documentation of this file.
1<?php
2
4
5use DateTimeInterface;
7
18
31 function isInTimeRange(DateTimeInterface $start, DateTimeInterface $end) {
32
33 $dtstart = isset($this->DTSTART) ? $this->DTSTART->getDateTime() : null;
34 if ($dtstart) {
35 $effectiveEnd = $dtstart;
36 if (!$this->DTSTART->hasTime()) {
37 $effectiveEnd = $effectiveEnd->modify('+1 day');
38 }
39
40 return ($start <= $effectiveEnd && $end > $dtstart);
41
42 }
43 return false;
44
45 }
46
62 function getValidationRules() {
63
64 return [
65 'UID' => 1,
66 'DTSTAMP' => 1,
67
68 'CLASS' => '?',
69 'CREATED' => '?',
70 'DTSTART' => '?',
71 'LAST-MODIFIED' => '?',
72 'ORGANIZER' => '?',
73 'RECURRENCE-ID' => '?',
74 'SEQUENCE' => '?',
75 'STATUS' => '?',
76 'SUMMARY' => '?',
77 'URL' => '?',
78
79 'RRULE' => '?',
80
81 'ATTACH' => '*',
82 'ATTENDEE' => '*',
83 'CATEGORIES' => '*',
84 'COMMENT' => '*',
85 'CONTACT' => '*',
86 'DESCRIPTION' => '*',
87 'EXDATE' => '*',
88 'RELATED-TO' => '*',
89 'RDATE' => '*',
90 ];
91
92 }
93
99 protected function getDefaults() {
100
101 return [
102 'UID' => 'sabre-vobject-' . VObject\UUIDUtil::getUUID(),
103 'DTSTAMP' => date('Ymd\\THis\\Z'),
104 ];
105
106 }
107}
An exception for terminatinating execution or to throw for unit testing.
isInTimeRange(DateTimeInterface $start, DateTimeInterface $end)
Returns true or false depending on if the event falls in the specified time-range.
Definition: VJournal.php:31
getDefaults()
This method should return a list of default property values.
Definition: VJournal.php:99
static getUUID()
Returns a pseudo-random v4 UUID.
Definition: UUIDUtil.php:27
$start
Definition: bench.php:8