class Message (View source)

An object representation of a generic message. Usually, you will use Error, Warning or Notice instead of this one.

Constants

SEVERITY_NOTICE

SEVERITY_WARNING

SEVERITY_ERROR

SEVERITY_OK

Properties

protected string $message

The error message, could also be a key for translation.

protected string $title

An optional title for the message (used eg. in flashMessages).

protected int $code

The error code.

protected array $arguments

The message arguments. Will be replaced in the message body.

protected string $severity

The severity of this message ('OK'), overwrite in your own implementation.

Methods

__construct(string $message, int|null $code = null, array $arguments = [], string $title = '')

Constructs this error

string
getMessage()

Returns the error message

bool
hasCode()

No description

int
getCode()

Returns the error code

array
getArguments()

No description

bool
hasTitle()

No description

string
getTitle()

No description

string
getSeverity()

No description

string
render()

No description

string
__toString()

Converts this error into a string

Details

__construct(string $message, int|null $code = null, array $arguments = [], string $title = '')

Constructs this error

Parameters

string $message

An english error message which is used if no other error message can be resolved

int|null $code

A unique error code

array $arguments

Array of arguments to be replaced in message

string $title

optional title for the message

string getMessage()

Returns the error message

Return Value

string

The error message

bool hasCode()

No description

Return Value

bool

int getCode()

Returns the error code

Return Value

int

The error code

array getArguments()

No description

Return Value

array

bool hasTitle()

No description

Return Value

bool

string getTitle()

No description

Return Value

string

string getSeverity()

No description

Return Value

string

string render()

No description

Return Value

string

string __toString()

Converts this error into a string

Return Value

string