You are here

public function LegacyMessenger::all in Drupal 8

Gets all messages.

Return value

string[][]|\Drupal\Component\Render\MarkupInterface[][] Keys are message types and values are indexed arrays of messages. Message types are either self::TYPE_STATUS, self::TYPE_WARNING, or self::TYPE_ERROR.

Overrides MessengerInterface::all

File

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

Class

LegacyMessenger
Provides a LegacyMessenger implementation.

Namespace

Drupal\Core\Messenger

Code

public function all() {

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