You are here

public function LegacyMessenger::getMessagesByType in Service Container 7.2

Same name and namespace in other branches
  1. 8 src/Messenger/LegacyMessenger.php \Drupal\service_container\Messenger\LegacyMessenger::getMessagesByType()
  2. 7 src/Messenger/LegacyMessenger.php \Drupal\service_container\Messenger\LegacyMessenger::getMessagesByType()

Gets all messages of a certain type.

Parameters

string $type: The messages' type. Either self::STATUS, self::WARNING, or self::ERROR.

Return value

string[]

Overrides MessengerInterface::getMessagesByType

File

src/Messenger/LegacyMessenger.php, line 52
Contains \Drupal\service_container\LegacyMessenger.

Class

LegacyMessenger
Class that manage the messages in Drupal.

Namespace

Drupal\service_container\Messenger

Code

public function getMessagesByType($type) {
  $messages = $this->drupal7
    ->drupal_get_messages($type, FALSE);
  return isset($messages[$type]) ? $messages[$type] : array();
}