Get all flash messages (with given severity) currently available and remove them from the container.

@param string $severity severity of the messages (One of the Message::SEVERITY_* constants)
@return array<Message>
@api
14872
public function getMessagesAndFlush($severity = null)
    {
        $messages = $this->getMessages($severity);
        if (count($messages) > 0) {
            $this->flush($severity);
        }
        return $messages;
    }
124881
public function getAllMessage()
    {
        $messages = [];
        foreach (array_keys($this->errors) as $key) {
            $messages[$key] = $this->getMessage($key);
        }
        return $messages;
    }
1276315
public function render() {
		$flashMessages = $this->controllerContext->getFlashMessageContainer()->getMessagesAndFlush();
		if (count($flashMessages) > 0) {
			$tagContent = '';
			foreach ($flashMessages as $singleFlashMessage) {

				// set the severity
				$severity = 'alert-info';

				switch ($singleFlashMessage->getSeverity()) {
					case 'Notice':	$severity = 'alert-info';
						break;
					case 'Information':	$severity = 'alert-info';
						break;
					case 'OK':	$severity = 'alert-success';
						break;
					case 'Warning': $severity = 'alert-warning';
						break;
					case 'Error': $severity = 'alert-error';
						break;
				}

				// check if there's a title and use it then
				$title = '';
				if ($singleFlashMessage->getTitle() != '') {
					$title = '<strong>' . $singleFlashMessage->getTitle() . '</strong>&nbsp;';
				}

				// put it all together
				$tagContent .= '<div class="alert ' . $severity . '"><strong>' . $title . '</strong>' .
					$singleFlashMessage->getMessage()  . '</div>';
			}

			$this->tag->setContent($tagContent);
			return $this->tag->render();
		}
		return '';
	}
706220
public function redirect(array $flashes = array())
    {
        foreach($flashes as $type => $message){
            $this->getAppController()->flash()->add($type, $message);
        }
        return $this->getAppController()->redirect($this->getRequest()->getRequestUri());
    }
959663
protected function addIndexQueueFlashMessage($label, $severity)
    {
        $this->addFlashMessage(LocalizationUtility::translate($label, 'Solr'), LocalizationUtility::translate('solr.backend.index_queue_module.flashmessage.title', 'Solr'), $severity);
    }
1343129
protected function getSeverityString($severity)
    {
        switch ($severity) {
            case Log::Error:
                return 'Error';
            case Log::Warning:
                return 'Warning';
            case Log::Notice:
                return 'Notice';
            case Log::Info:
                return 'Info';
            case Log::Debug:
            default:
                return 'Debug';
        }
    }
1090690
public function getFlashVarsAsString()
	{
		$params=array();
		foreach($this->flashVars as $k=>$v)
			$params[]=urlencode($k).'='.urlencode($v);
		return CJavaScript::quote(implode('&',$params));
	}
67188
private function format($message, $severity)
    {
        $msg = date("m-d-Y") . " " . date("G:i:s") . " " . self::$remoteIp;

        $IPLength = strlen(self::$remoteIp);
        $numWhitespaces = 15 - $IPLength;

        for ($i = 0; $i < $numWhitespaces; $i++) {
            $msg .= " ";
        }

        $msg .= " " . $severity . ": ";

        $lastSlashIndex = strrpos(self::$script, "/");
        $fileName = self::$script;

        if ($lastSlashIndex !== false) {
            $fileName = substr(self::$script, $lastSlashIndex + 1);
        }

        $msg .= $fileName . "\t";
        $msg .= ": " . $message . "\r\n";

        return $msg;
    }
556802
public function swrite($severity, $value='')
    {
        if(sizeof($this->cache) == $this->messageLimit) {
            array_shift($this->cache);
        }
        $this->cache[] = $value;
    }
1204246
public function allFlashes()
    {
        if ( ! $this->isOpened()) {
            $this->start();
        }
        if (!empty($this->old_flashes)) {
            $_oldf = $this->old_flashes;
            $this->old_flashes = array();
            return $_oldf;
        }
        return null;
    }
854723
public function getMessages(array $types, $maxAttempts = 5)
    {
        $query = $this->registry->getManagerForClass($this->class)->getRepository($this->class)
            ->createQueryBuilder('m')
            ->where('m.state = :erroneousState')
            ->andWhere('m.restartCount < :maxAttempts');

        $parameters = [
            'erroneousState' => MessageInterface::STATE_ERROR,
            'maxAttempts' => $maxAttempts,
        ];

        if (\count($types) > 0) {
            $query->andWhere('m.type IN (:types)');
            $parameters['types'] = $types;
        }

        $query->setParameters($parameters);

        return $query->getQuery()->execute();
    }
542009
public function flashMessage($message, $type = 'default', $comment=null, $icon=null, $width=50, $iconSize="lg", $timeout=5)
    {
        $id = $this->getParameterId('flash');
        $presenter = $this->getPresenter();
        if($presenter instanceof Presenter){
            $messages = $presenter->getFlashSession()->$id;
        } else {
            $messages = null;
        }

        $messages[] = $flash = (object) [
             'title' => $message,
             'type' => $type,
             'comment' => $comment,
             'icon' => $icon,
             'width' => $width,
             'iconSize' =>$iconSize,
             'timeout' => $timeout
         ];
        $this->getTemplate()->flashes = $messages;
        if($presenter instanceof Presenter){
            $presenter->getFlashSession()->$id = $messages;
        }
        return $flash;
    }
777539
protected function renderFlashMessages()
    {
        $allMessages = $this->controllerContext->getFlashMessageContainer()->getMessagesAndFlush();
        $messages = [];
        foreach ($allMessages as $message) {
            /** @var \TYPO3\Flow\Error\Message $message */
            $messages[] = [
                'message' => $message->render(),
                'title' => $message->getTitle(),
                'severity' => $message->getSeverity()
            ];
        }
        return $messages;
    }
951931
public function getAll() {
		if ($this->hasAny()) {
			$messages = $_SESSION[self::SESSION_KEY_FLASH];

			$_SESSION[self::SESSION_KEY_FLASH] = [];

			return $messages;
		}
		else {
			return [];
		}
	}
1211879
protected function findNextMessages($types)
    {
        return $this->messageManager->findByAttempts(
            $this->types,
            MessageInterface::STATE_ERROR,
            $this->batchSize,
            $this->maxAttempts,
            $this->attemptDelay
        );
    }
1109744
public function messages($reset = true)
    {
        $messages = $this->_messages;
        if ($reset) {
            $this->_messages = array();
        }

        return $messages;
    }
751997
public function getMessages($removeOnGet = false){
	$messages = $this->session->get("FlashInSession", []);
	if($removeOnGet){
	    $this->clear();
	}
	return $messages;
    }