Back to MessageRenderer class

Method getData

private array
getData
()
Get and prepare system message data for output
Returns
  • array An array contains system message
Since
  • 3.5

Method getData - Source code

/**
 * Get and prepare system message data for output
 *
 * @return  array  An array contains system message
 *
 * @since   3.5
 */
private function getData()
{
    // Initialise variables.
    $lists = array();
    // Get the message queue
    $messages = Factory::getApplication()->getMessageQueue();
    // Build the sorted message list
    if (\is_array($messages) && !empty($messages)) {
        foreach ($messages as $msg) {
            if (isset($msg['type']) && isset($msg['message'])) {
                $lists[$msg['type']][] = $msg['message'];
            }
        }
    }
    return $lists;
}