public function addFlashMessage($messageBody, $messageTitle = '', $severity = Error\Message::SEVERITY_OK, array $messageArguments = [], $messageCode = null)
    {
        if (!is_string($messageBody)) {
            throw new \InvalidArgumentException('The message body must be of type string, "' . gettype($messageBody) . '" given.', 1243258395);
        }
        switch ($severity) {
            case Error\Message::SEVERITY_NOTICE:
                $message = new Error\Notice($messageBody, $messageCode, $messageArguments, $messageTitle);
                break;
            case Error\Message::SEVERITY_WARNING:
                $message = new Error\Warning($messageBody, $messageCode, $messageArguments, $messageTitle);
                break;
            case Error\Message::SEVERITY_ERROR:
                $message = new Error\Error($messageBody, $messageCode, $messageArguments, $messageTitle);
                break;
            default:
                $message = new Error\Message($messageBody, $messageCode, $messageArguments, $messageTitle);
            break;
        }
        $this->flashMessageContainer->addMessage($message);
    }
public function addFlashMessage($messageBody, $messageTitle = '', $severity = Error\Message::SEVERITY_OK, array $messageArguments = [], $messageCode = null)
    {
        if (!is_string($messageBody)) {
            throw new \InvalidArgumentException('The message body must be of type string, "' . gettype($messageBody) . '" given.', 1243258395);
        }
        switch ($severity) {
            case Error\Message::SEVERITY_NOTICE:
                $message = new Error\Notice($messageBody, $messageCode, $messageArguments, $messageTitle);
                break;
            case Error\Message::SEVERITY_WARNING:
                $message = new Error\Warning($messageBody, $messageCode, $messageArguments, $messageTitle);
                break;
            case Error\Message::SEVERITY_ERROR:
                $message = new Error\Error($messageBody, $messageCode, $messageArguments, $messageTitle);
                break;
            default:
                $message = new Error\Message($messageBody, $messageCode, $messageArguments, $messageTitle);
            break;
        }
        $this->flashMessageContainer->addMessage($message);
    }
public function addFlashMessage ( $ messageBody , $ messageTitle = '' , $ severity = Error \ Message :: SEVERITY_OK , array $ messageArguments = [ ] , $ messageCode = null ) { if ( ! is_string ( $ messageBody ) ) { throw new \ InvalidArgumentException ( 'The message body must be of type string, "' . gettype ( $ messageBody ) . '" given.' , 1243258395 ) ; } switch ( $ severity ) { case Error \ Message :: SEVERITY_NOTICE : $ message = new Error \ Notice ( $ messageBody , $ messageCode , $ messageArguments , $ messageTitle ) ; break ; case Error \ Message :: SEVERITY_WARNING : $ message = new Error \ Warning ( $ messageBody , $ messageCode , $ messageArguments , $ messageTitle ) ; break ; case Error \ Message :: SEVERITY_ERROR : $ message = new Error \ Error ( $ messageBody , $ messageCode , $ messageArguments , $ messageTitle ) ; break ; default : $ message = new Error \ Message ( $ messageBody , $ messageCode , $ messageArguments , $ messageTitle ) ; break ; } $ this -> flashMessageContainer -> addMessage ( $ message ) ; }
Creates a Message object and adds it to the FlashMessageContainer.

This method should be used to add FlashMessages rather than interacting with the container directly.

@param string $messageBody text of the FlashMessage
@param string $messageTitle optional header of the FlashMessage
@param string $severity severity of the FlashMessage (one of the Message::SEVERITY_* constants)
@param array $messageArguments arguments to be passed to the FlashMessage
@param integer $messageCode
@return void
@throws \InvalidArgumentException if the message body is no string
@see Error\Message
@api
Creates a Message object and adds it to the FlashMessageContainer .