FormError
in package
Wraps errors in forms.
Tags
Table of Contents
Properties
- $messageParameters : mixed
- $messagePluralization : mixed
- $messageTemplate : mixed
- $cause : mixed
- $message : string
- $origin : mixed
- The form that spawned this error.
Methods
- __construct() : mixed
- Any array key in $messageParameters will be used as a placeholder in $messageTemplate.
- getCause() : mixed
- Returns the cause of this error.
- getMessage() : string
- Returns the error message.
- getMessageParameters() : array<string|int, mixed>
- Returns the parameters to be inserted in the message template.
- getMessagePluralization() : int|null
- Returns the value for error message pluralization.
- getMessageTemplate() : string
- Returns the error message template.
- getOrigin() : FormInterface|null
- Returns the form that caused this error.
- setOrigin() : mixed
- Sets the form that caused this error.
Properties
$messageParameters
protected
mixed
$messageParameters
$messagePluralization
protected
mixed
$messagePluralization
$messageTemplate
protected
mixed
$messageTemplate
$cause
private
mixed
$cause
$message
private
string
$message
$origin
The form that spawned this error.
private
mixed
$origin
= null
Methods
__construct()
Any array key in $messageParameters will be used as a placeholder in $messageTemplate.
public
__construct(string $message[, string|null $messageTemplate = null ][, array<string|int, mixed> $messageParameters = [] ][, int|null $messagePluralization = null ][, mixed $cause = null ]) : mixed
Parameters
- $message : string
-
The translated error message
- $messageTemplate : string|null = null
-
The template for the error message
- $messageParameters : array<string|int, mixed> = []
-
The parameters that should be substituted in the message template
- $messagePluralization : int|null = null
-
The value for error message pluralization
- $cause : mixed = null
-
The cause of the error
Tags
getCause()
Returns the cause of this error.
public
getCause() : mixed
getMessage()
Returns the error message.
public
getMessage() : string
Return values
stringgetMessageParameters()
Returns the parameters to be inserted in the message template.
public
getMessageParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>getMessagePluralization()
Returns the value for error message pluralization.
public
getMessagePluralization() : int|null
Return values
int|nullgetMessageTemplate()
Returns the error message template.
public
getMessageTemplate() : string
Return values
stringgetOrigin()
Returns the form that caused this error.
public
getOrigin() : FormInterface|null
Return values
FormInterface|nullsetOrigin()
Sets the form that caused this error.
public
setOrigin(FormInterface $origin) : mixed
This method must only be called once.
Parameters
- $origin : FormInterface