public function Messenger::addMessage in Open Social 8.8
Same name and namespace in other branches
- 8.9 modules/custom/social_demo/src/Messenger.php \Drupal\social_demo\Messenger::addMessage()
 - 10.3.x modules/custom/social_demo/src/Messenger.php \Drupal\social_demo\Messenger::addMessage()
 - 10.0.x modules/custom/social_demo/src/Messenger.php \Drupal\social_demo\Messenger::addMessage()
 - 10.1.x modules/custom/social_demo/src/Messenger.php \Drupal\social_demo\Messenger::addMessage()
 - 10.2.x modules/custom/social_demo/src/Messenger.php \Drupal\social_demo\Messenger::addMessage()
 
Adds a new message to the queue.
The messages will be displayed in the order they got added later.
Parameters
string|\Drupal\Component\Render\MarkupInterface $message: (optional) The translated message to be displayed to the user. For consistency with other messages, it should begin with a capital letter and end with a period.
string $type: (optional) The message's type. Either self::TYPE_STATUS, self::TYPE_WARNING, or self::TYPE_ERROR.
bool $repeat: (optional) If this is FALSE and the message is already set, then the message won't be repeated. Defaults to FALSE.
Return value
$this
Overrides Messenger::addMessage
File
- modules/
custom/ social_demo/ src/ Messenger.php, line 21  
Class
- Messenger
 - Provide a Messenger service for use during demo content generation.
 
Namespace
Drupal\social_demoCode
public function addMessage($message, $type = MessengerBase::TYPE_STATUS, $repeat = FALSE) {
  // Skip all status messages while the demo content module is enabled.
  // This avoids follow and enrollment messages that are not needed for the
  // admin. The demo content module provides its own way of showing progress
  // in drush.
  if ($type === MessengerBase::TYPE_STATUS) {
    return $this;
  }
  return MessengerBase::addMessage($message, $type, $repeat);
}