interface MessageInterface
Same name in other branches
- 8.9.x core/modules/contact/src/MessageInterface.php \Drupal\contact\MessageInterface
- 10 core/modules/contact/src/MessageInterface.php \Drupal\contact\MessageInterface
- 11.x core/modules/contact/src/MessageInterface.php \Drupal\contact\MessageInterface
Provides an interface defining a contact message entity.
Hierarchy
- interface \Drupal\Core\Entity\FieldableEntityInterface extends \Drupal\Core\Entity\EntityInterface; interface \Drupal\Core\Entity\SynchronizableInterface extends \Drupal\Core\Entity\EntityInterface; interface \Drupal\Core\Entity\TranslatableRevisionableInterface extends \Drupal\Core\Entity\TranslatableInterface \Drupal\Core\Entity\RevisionableInterface
- interface \Drupal\Core\Entity\ContentEntityInterface extends \Drupal\Core\Entity\Traversable \Drupal\Core\Entity\FieldableEntityInterface \Drupal\Core\Entity\TranslatableRevisionableInterface \Drupal\Core\Entity\SynchronizableInterface
- interface \Drupal\contact\MessageInterface extends \Drupal\Core\Entity\ContentEntityInterface
- interface \Drupal\Core\Entity\ContentEntityInterface extends \Drupal\Core\Entity\Traversable \Drupal\Core\Entity\FieldableEntityInterface \Drupal\Core\Entity\TranslatableRevisionableInterface \Drupal\Core\Entity\SynchronizableInterface
Expanded class hierarchy of MessageInterface
All classes that implement MessageInterface
2 files declare their use of MessageInterface
- MailHandlerTest.php in core/
modules/ contact/ tests/ src/ Unit/ MailHandlerTest.php - Message.php in core/
modules/ contact/ src/ Entity/ Message.php
File
-
core/
modules/ contact/ src/ MessageInterface.php, line 10
Namespace
Drupal\contactView source
interface MessageInterface extends ContentEntityInterface {
/**
* Returns the form this contact message belongs to.
*
* @return \Drupal\contact\ContactFormInterface
* The contact form entity.
*/
public function getContactForm();
/**
* Returns the name of the sender.
*
* @return string
* The name of the message sender.
*/
public function getSenderName();
/**
* Sets the name of the message sender.
*
* @param string $sender_name
* The name of the message sender.
*/
public function setSenderName($sender_name);
/**
* Returns the email address of the sender.
*
* @return string
* The email address of the message sender.
*/
public function getSenderMail();
/**
* Sets the email address of the sender.
*
* @param string $sender_mail
* The email address of the message sender.
*/
public function setSenderMail($sender_mail);
/**
* Returns the message subject.
*
* @return string
* The message subject.
*/
public function getSubject();
/**
* Sets the subject for the email.
*
* @param string $subject
* The message subject.
*/
public function setSubject($subject);
/**
* Returns the message body.
*
* @return string
* The message body.
*/
public function getMessage();
/**
* Sets the email message to send.
*
* @param string $message
* The message body.
*/
public function setMessage($message);
/**
* Returns TRUE if a copy should be sent to the sender.
*
* @return bool
* TRUE if a copy should be sent, FALSE if not.
*/
public function copySender();
/**
* Sets if the sender should receive a copy of this email or not.
*
* @param bool $inform
* TRUE if a copy should be sent, FALSE if not.
*/
public function setCopySender($inform);
/**
* Returns TRUE if this is the personal contact form.
*
* @return bool
* TRUE if the message bundle is personal.
*/
public function isPersonal();
/**
* Returns the user this message is being sent to.
*
* @return \Drupal\user\UserInterface
* The user entity of the recipient, NULL if this is not a personal message.
*/
public function getPersonalRecipient();
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overrides |
---|---|---|---|---|
MessageInterface::copySender | public | function | Returns TRUE if a copy should be sent to the sender. | 1 |
MessageInterface::getContactForm | public | function | Returns the form this contact message belongs to. | 1 |
MessageInterface::getMessage | public | function | Returns the message body. | 1 |
MessageInterface::getPersonalRecipient | public | function | Returns the user this message is being sent to. | 1 |
MessageInterface::getSenderMail | public | function | Returns the email address of the sender. | 1 |
MessageInterface::getSenderName | public | function | Returns the name of the sender. | 1 |
MessageInterface::getSubject | public | function | Returns the message subject. | 1 |
MessageInterface::isPersonal | public | function | Returns TRUE if this is the personal contact form. | 1 |
MessageInterface::setCopySender | public | function | Sets if the sender should receive a copy of this email or not. | 1 |
MessageInterface::setMessage | public | function | Sets the email message to send. | 1 |
MessageInterface::setSenderMail | public | function | Sets the email address of the sender. | 1 |
MessageInterface::setSenderName | public | function | Sets the name of the message sender. | 1 |
MessageInterface::setSubject | public | function | Sets the subject for the email. | 1 |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.