You are here

public function Message::setTemplate in Message 8

Set the message template.

Parameters

MessageTemplateInterface $template: Message template.

Return value

\Drupal\message\MessageInterface Returns the message object.

Overrides MessageInterface::setTemplate

File

src/Entity/Message.php, line 76

Class

Message
Defines the Message entity class.

Namespace

Drupal\message\Entity

Code

public function setTemplate(MessageTemplateInterface $template) {
  $this
    ->set('template', $template);
  return $this;
}