-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathCalDAVCalendar.php
106 lines (87 loc) · 2.07 KB
/
CalDAVCalendar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
/**
* CalDAVCalendar
*
* Copyright 2014 Michael Palm <[email protected]>
*
* This class represents an accsessible calendar on the server.
*
* I think the functions
* - getURL()
* - getDisplayName()
* - getCalendarID()
* - getRGBAcolor()
* - getRBGcolor()
* are pretty self-explanatory.
*
*
* getCTag() returns the ctag of the calendar.
* The ctag is an hash-value used to check, if the client is up to date. The ctag changes everytime
* someone changes something in the calendar. So, to check if anything happend since your last visit:
* just compare the ctags.
*
* getOrder() returns the order of the calendar in the list of calendars
*
*
* @package simpleCalDAV
*
*/
class CalDAVCalendar {
private $url;
private $displayname;
private $ctag;
private $calendar_id;
private $rgba_color;
private $rbg_color;
private $order;
function __construct ( $url, $displayname = null, $ctag = null, $calendar_id = null, $rbg_color = null, $order = null ) {
$this->url = $url;
$this->displayname = $displayname;
$this->ctag = $ctag;
$this->calendar_id = $calendar_id;
$this->rbg_color = $rbg_color;
$this->order = $order;
}
function __toString () {
return( '(URL: '.$this->url.' Ctag: '.$this->ctag.' Displayname: '.$this->displayname .')'. "\n" );
}
// Getters
function getURL () {
return $this->url;
}
function getDisplayName () {
return $this->displayname;
}
function getCTag () {
return $this->ctag;
}
function getCalendarID () {
return $this->calendar_id;
}
function getRBGcolor () {
return $this->rbg_color;
}
function getOrder () {
return $this->order;
}
// Setters
function setURL ( $url ) {
$this->url = $url;
}
function setDisplayName ( $displayname ) {
$this->displayname = $displayname;
}
function setCtag ( $ctag ) {
$this->ctag = $ctag;
}
function setCalendarID ( $calendar_id ) {
$this->calendar_id = $calendar_id;
}
function setRBGcolor ( $rbg_color ) {
$this->rbg_color = $rbg_color;
}
function setOrder ( $order ) {
$this->order = $order;
}
}
?>