Message.php 3.1 KB

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