AbstractMessage implements JsonSerializable
AbstractYes
A class used for any kind of messages.
Table of Contents
Interfaces
- JsonSerializable
Constants
Properties
- $message : string
- The message
- $severity : int
- The message's severity
- $title : string
- The message's title
Methods
- __toString() : string
- Creates a string representation of the message. Useful for command line use.
- getMessage() : string
- Gets the message.
- getSeverity() : int
- Gets the message' severity.
- getTitle() : string
- Gets the message's title.
- jsonSerialize() : array<string|int, mixed>
- setMessage() : mixed
- Sets the message
- setSeverity() : mixed
- Sets the message' severity
- setTitle() : mixed
- Sets the message's title
Constants
ERROR
public
mixed
ERROR
= 2
INFO
public
mixed
INFO
= -1
NOTICE
public
mixed
NOTICE
= -2
OK
public
mixed
OK
= 0
WARNING
public
mixed
WARNING
= 1
Properties
$message
The message
protected
string
$message
= ''
$severity
The message's severity
protected
int
$severity
= self::OK
$title
The message's title
protected
string
$title
= ''
Methods
__toString()
Creates a string representation of the message. Useful for command line use.
public
__toString() : string
Return values
string —A string representation of the message.
getMessage()
Gets the message.
public
getMessage() : string
Return values
string —The message.
getSeverity()
Gets the message' severity.
public
getSeverity() : int
Return values
int —The message' severity, must be one of AbstractMessage::INFO or similar constants
getTitle()
Gets the message's title.
public
getTitle() : string
Return values
string —The message's title.
jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed> —Data which can be serialized by json_encode()
setMessage()
Sets the message
public
setMessage(string $message) : mixed
Parameters
- $message : string
-
The message
setSeverity()
Sets the message' severity
public
setSeverity([int $severity = self::OK ]) : mixed
Parameters
- $severity : int = self::OK
-
The severity, must be one of AbstractMessage::INFO or similar constants
setTitle()
Sets the message's title
public
setTitle(string $title) : mixed
Parameters
- $title : string
-
The message's title