class Error extends AbstractError (View source)

Properties

protected FieldInterface|null $field

The field associated to the error.

from  AbstractError
private bool Since: concrete5 8.5.0a3
$messageContainsHtml

Does the message contain an HTML-formatted string?

from  AbstractError
protected string $message

The error message.

Methods

string
__toString()

Get the error message.

getField()

Get the field associated to the error.

setField(FieldInterface $field)

Set the field associated to the error.

bool
messageContainsHtml()

Does the message contain an HTML-formatted string?

$this
setMessageContainsHtml(bool $value)

Does the message contain an HTML-formatted string?

jsonSerialize()

{@inheritdoc}

__construct(string|mixed $message, FieldInterface $field = null)

Class constructor.

string
getMessage()

Get the error message.

setMessage(string|mixed $message)

Set the error message.

Details

string __toString()

Get the error message.

Return Value

string

FieldInterface|null getField()

Get the field associated to the error.

Return Value

FieldInterface|null

setField(FieldInterface $field)

Set the field associated to the error.

Parameters

FieldInterface $field

bool messageContainsHtml()

Since: concrete5 8.5.0a3

Does the message contain an HTML-formatted string?

$this setMessageContainsHtml(bool $value)

Since: concrete5 8.5.0a3

Does the message contain an HTML-formatted string?

Parameters

bool $value

Return Value

$this

jsonSerialize()

{@inheritdoc}

See also

\JsonSerializable::jsonSerialize()

__construct(string|mixed $message, FieldInterface $field = null)

Class constructor.

Parameters

string|mixed $message

a string, a scalar, or an object that implements the __toString() method

FieldInterface $field

string getMessage()

Get the error message.

Return Value

string

See also

ErrorInterface::getMessage

setMessage(string|mixed $message)

Set the error message.

Parameters

string|mixed $message

a string, a scalar, or an object that implements the __toString() method