You are here

public function WebformHelpManager::addNotification in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformHelpManager.php \Drupal\webform\WebformHelpManager::addNotification()

Sets a notification to be displayed to webform administrators.

@internal Currently being used to display notifications related to updates.

Parameters

string $id: The notification id.

string|\Drupal\Component\Render\MarkupInterface|array $message: The notification to be displayed to webform administrators.

string $type: (optional) The message's type. Defaults to 'status'. These values are supported: 'info', 'status', 'warning', 'error'.

Overrides WebformHelpManagerInterface::addNotification

File

src/WebformHelpManager.php, line 211

Class

WebformHelpManager
Webform help manager.

Namespace

Drupal\webform

Code

public function addNotification($id, $message, $type = 'status') {
  $notifications = $this->state
    ->get('webform_help_notifications', []);
  $notifications[$type][$id] = $message;
  $this->state
    ->set('webform_help_notifications', $notifications);
}