You are here

public function SocialNodeMessenger::addStatus in Open Social 10.3.x

Same name and namespace in other branches
  1. 10.0.x modules/social_features/social_node/src/Service/SocialNodeMessenger.php \Drupal\social_node\Service\SocialNodeMessenger::addStatus()
  2. 10.1.x modules/social_features/social_node/src/Service/SocialNodeMessenger.php \Drupal\social_node\Service\SocialNodeMessenger::addStatus()
  3. 10.2.x modules/social_features/social_node/src/Service/SocialNodeMessenger.php \Drupal\social_node\Service\SocialNodeMessenger::addStatus()

Adds a new status message to the queue.

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.

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::addStatus

File

modules/social_features/social_node/src/Service/SocialNodeMessenger.php, line 53

Class

SocialNodeMessenger
The messenger service.

Namespace

Drupal\social_node\Service

Code

public function addStatus($message, $repeat = FALSE) {
  $messages = $this->moduleHandler
    ->invokeAll('social_node_message', [
    $this->node,
  ]);
  if ($messages) {
    $message = end($messages);
  }
  return parent::addStatus($message, $repeat);
}