mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-05-24 08:30:10 +02:00
Store messages in the current user session to be able to fetch messages from other controllers, so that the use can be redirected back to the index, instead of staying in the original action refs #5100
57 lines
1011 B
PHP
57 lines
1011 B
PHP
<?php
|
|
|
|
namespace Icinga\User;
|
|
|
|
use \Zend_Log;
|
|
use \DateTime;
|
|
|
|
/**
|
|
* Class Message
|
|
*
|
|
* A Message with an additional logging level to indicate the type.
|
|
*
|
|
* @package Icinga\User
|
|
*/
|
|
class Message {
|
|
|
|
/**
|
|
* The content of this message
|
|
*
|
|
* @var string
|
|
*/
|
|
private $message;
|
|
|
|
/**
|
|
* The logging-level of this message
|
|
*/
|
|
private $level;
|
|
|
|
/**
|
|
* Create a new Message
|
|
*
|
|
* @param string $message The message content
|
|
* @param $level The status of the message
|
|
* * Zend_Log::INFO
|
|
* * Zend_Log::ERR
|
|
*/
|
|
public function __construct($message, $level = Zend_Log::INFO) {
|
|
$this->message = $message;
|
|
$this->level = $level;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getMessage()
|
|
{
|
|
return $this->message;
|
|
}
|
|
|
|
/**
|
|
* @return The
|
|
*/
|
|
public function getLevel()
|
|
{
|
|
return $this->level;
|
|
}
|
|
} |