public function PrivateMessageThreadManager::saveThread in Private Message 8.2
Same name and namespace in other branches
- 8 src/Service/PrivateMessageThreadManager.php \Drupal\private_message\Service\PrivateMessageThreadManager::saveThread()
Saves a private message thread.
A new thread will be created if one does not already exist.
Parameters
\Drupal\private_message\Entity\PrivateMessageInterface $message: The new message object.
array $recipients: (optional) An array of message recipients. Defaults to an empty array.
array $excludeFromMail: (optional) An array of members to exclude from notification emails. Defaults to an empty array.
\Drupal\private_message\Entity\PrivateMessageThreadInterface|null $thread: (optional) The private message thread. If NULL, one will be loaded using the recipients array.
Overrides PrivateMessageThreadManagerInterface::saveThread
File
- src/
Service/ PrivateMessageThreadManager.php, line 77
Class
- PrivateMessageThreadManager
- The Private Message generator class.
Namespace
Drupal\private_message\ServiceCode
public function saveThread(PrivateMessageInterface $message, array $recipients = [], array $excludeFromNotification = [], PrivateMessageThreadInterface $thread = NULL) {
$this->message = $message;
$this->thread = $thread;
$this->recipients = $recipients;
$this->excludeFromNotification = $excludeFromNotification;
$this
->getThread()
->addMessage()
->sendNotification();
}