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