You are here

public function WebformHelpManager::deleteNotification in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformHelpManager.php \Drupal\webform\WebformHelpManager::deleteNotification()

Delete a notification by id.

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

Parameters

string $id: The notification id.

Overrides WebformHelpManagerInterface::deleteNotification

File

src/WebformHelpManager.php, line 233

Class

WebformHelpManager
Webform help manager.

Namespace

Drupal\webform

Code

public function deleteNotification($id) {
  $notifications = $this->state
    ->get('webform_help_notifications', []);
  foreach ($notifications as &$messages) {
    unset($messages[$id]);
  }
  array_filter($notifications);
  $this->state
    ->set('webform_help_notifications', $notifications);
}