Message.php 3.1 KB

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