You are here

public function MessageQueueItem::addMessage in Courier 8

Same name and namespace in other branches
  1. 2.x src/Entity/MessageQueueItem.php \Drupal\courier\Entity\MessageQueueItem::addMessage()

Add a message to the message queue item.

Parameters

\Drupal\courier\ChannelInterface $message: The message to add to the message queue item.

Return value

\Drupal\courier\MessageQueueItemInterface Returns this message queue item for chaining.

Overrides MessageQueueItemInterface::addMessage

File

src/Entity/MessageQueueItem.php, line 65

Class

MessageQueueItem
Defines a Message queue item entity.

Namespace

Drupal\courier\Entity

Code

public function addMessage(ChannelInterface $message) {
  $this->messages[] = $message;
  return $this;
}