MessageInterface.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. namespace Drupal\contact;
  3. use Drupal\Core\Entity\ContentEntityInterface;
  4. /**
  5. * Provides an interface defining a contact message entity.
  6. */
  7. interface MessageInterface extends ContentEntityInterface {
  8. /**
  9. * Returns the form this contact message belongs to.
  10. *
  11. * @return \Drupal\contact\ContactFormInterface
  12. * The contact form entity.
  13. */
  14. public function getContactForm();
  15. /**
  16. * Returns the name of the sender.
  17. *
  18. * @return string
  19. * The name of the message sender.
  20. */
  21. public function getSenderName();
  22. /**
  23. * Sets the name of the message sender.
  24. *
  25. * @param string $sender_name
  26. * The name of the message sender.
  27. */
  28. public function setSenderName($sender_name);
  29. /**
  30. * Returns the email address of the sender.
  31. *
  32. * @return string
  33. * The email address of the message sender.
  34. */
  35. public function getSenderMail();
  36. /**
  37. * Sets the email address of the sender.
  38. *
  39. * @param string $sender_mail
  40. * The email address of the message sender.
  41. */
  42. public function setSenderMail($sender_mail);
  43. /**
  44. * Returns the message subject.
  45. *
  46. * @return string
  47. * The message subject.
  48. */
  49. public function getSubject();
  50. /**
  51. * Sets the subject for the email.
  52. *
  53. * @param string $subject
  54. * The message subject.
  55. */
  56. public function setSubject($subject);
  57. /**
  58. * Returns the message body.
  59. *
  60. * @return string
  61. * The message body.
  62. */
  63. public function getMessage();
  64. /**
  65. * Sets the email message to send.
  66. *
  67. * @param string $message
  68. * The message body.
  69. */
  70. public function setMessage($message);
  71. /**
  72. * Returns TRUE if a copy should be sent to the sender.
  73. *
  74. * @return bool
  75. * TRUE if a copy should be sent, FALSE if not.
  76. */
  77. public function copySender();
  78. /**
  79. * Sets if the sender should receive a copy of this email or not.
  80. *
  81. * @param bool $inform
  82. * TRUE if a copy should be sent, FALSE if not.
  83. */
  84. public function setCopySender($inform);
  85. /**
  86. * Returns TRUE if this is the personal contact form.
  87. *
  88. * @return bool
  89. * TRUE if the message bundle is personal.
  90. */
  91. public function isPersonal();
  92. /**
  93. * Returns the user this message is being sent to.
  94. *
  95. * @return \Drupal\user\UserInterface
  96. * The user entity of the recipient, NULL if this is not a personal message.
  97. */
  98. public function getPersonalRecipient();
  99. }