annotate vendor/sabre/vobject/lib/ITip/Message.php @ 7:430dbd5346f7

vendor sabre as distributed
author Charlie Root
date Sat, 13 Jan 2018 09:06:10 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
1 <?php
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
3 namespace Sabre\VObject\ITip;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
4
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
5 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
6 * This class represents an iTip message
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
7 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
8 * A message holds all the information relevant to the message, including the
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
9 * object itself.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
10 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
11 * It should for the most part be treated as immutable.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
12 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
13 * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/).
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
14 * @author Evert Pot (http://evertpot.com/)
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
15 * @license http://sabre.io/license/ Modified BSD License
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
16 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
17 class Message {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
18
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
19 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
20 * The object's UID
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
21 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
22 * @var string
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
23 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
24 public $uid;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
25
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
26 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
27 * The component type, such as VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
28 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
29 * @var string
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
30 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
31 public $component;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
32
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
33 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
34 * Contains the ITip method, which is something like REQUEST, REPLY or
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
35 * CANCEL.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
36 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
37 * @var string
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
38 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
39 public $method;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
40
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
41 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
42 * The current sequence number for the event.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
43 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
44 * @var int
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
45 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
46 public $sequence;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
47
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
48 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
49 * The senders' email address.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
50 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
51 * Note that this does not imply that this has to be used in a From: field
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
52 * if the message is sent by email. It may also be populated in Reply-To:
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
53 * or not at all.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
54 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
55 * @var string
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
56 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
57 public $sender;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
58
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
59 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
60 * The name of the sender. This is often populated from a CN parameter from
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
61 * either the ORGANIZER or ATTENDEE, depending on the message.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
62 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
63 * @var string|null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
64 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
65 public $senderName;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
66
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
67 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
68 * The recipient's email address.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
69 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
70 * @var string
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
71 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
72 public $recipient;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
73
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
74 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
75 * The name of the recipient. This is usually populated with the CN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
76 * parameter from the ATTENDEE or ORGANIZER property, if it's available.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
77 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
78 * @var string|null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
79 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
80 public $recipientName;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
81
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
82 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
83 * After the message has been delivered, this should contain a string such
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
84 * as : 1.1;Sent or 1.2;Delivered.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
85 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
86 * In case of a failure, this will hold the error status code.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
87 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
88 * See:
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
89 * http://tools.ietf.org/html/rfc6638#section-7.3
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
90 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
91 * @var string
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
92 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
93 public $scheduleStatus;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
94
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
95 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
96 * The iCalendar / iTip body.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
97 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
98 * @var \Sabre\VObject\Component\VCalendar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
99 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
100 public $message;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
101
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
102 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
103 * This will be set to true, if the iTip broker considers the change
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
104 * 'significant'.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
105 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
106 * In practice, this means that we'll only mark it true, if for instance
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
107 * DTSTART changed. This allows systems to only send iTip messages when
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
108 * significant changes happened. This is especially useful for iMip, as
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
109 * normally a ton of messages may be generated for normal calendar use.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
110 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
111 * To see the list of properties that are considered 'significant', check
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
112 * out Sabre\VObject\ITip\Broker::$significantChangeProperties.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
113 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
114 * @var bool
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
115 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
116 public $significantChange = true;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
117
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
118 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
119 * Returns the schedule status as a string.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
120 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
121 * For example:
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
122 * 1.2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
123 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
124 * @return mixed bool|string
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
125 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
126 public function getScheduleStatus() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
127
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
128 if(!$this->scheduleStatus) {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
129
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
130 return false;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
131
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
132 } else {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
133
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
134 list($scheduleStatus) = explode(';', $this->scheduleStatus);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
135 return $scheduleStatus;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
136
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
137 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
138
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
139 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
140
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
141 }