You are here

public function LegacyMessenger::deleteAll in Drupal 8

Deletes all messages.

Return value

string[]|\Drupal\Component\Render\MarkupInterface[] The deleted messages.

Overrides MessengerInterface::deleteAll

File

core/lib/Drupal/Core/Messenger/LegacyMessenger.php, line 166

Class

LegacyMessenger
Provides a LegacyMessenger implementation.

Namespace

Drupal\Core\Messenger

Code

public function deleteAll() {

  // Proxy to the Messenger service, if it exists.
  if ($messenger = $this
    ->getMessengerService()) {
    return $messenger
      ->deleteAll();
  }
  $messages = static::$messages;
  static::$messages = NULL;
  return $messages;
}