FormError
class FormError implements Serializable
Wraps errors in forms.
Properties
protected | $messageTemplate | ||
protected | $messageParameters | ||
protected | $messagePluralization |
Methods
__construct(string|null $message, string $messageTemplate = null, array $messageParameters = array(), int $messagePluralization = null, mixed $cause = null)
Any array key in $messageParameters will be used as a placeholder in $messageTemplate.
string
getMessage()
Returns the error message.
string
getMessageTemplate()
Returns the error message template.
array
getMessageParameters()
Returns the parameters to be inserted in the message template.
int|null
getMessagePluralization()
Returns the value for error message pluralization.
mixed
getCause()
Returns the cause of this error.
getOrigin()
Returns the form that caused this error.
string
serialize()
Serializes this error.
unserialize(string $serialized)
Unserializes a serialized error.
Details
__construct(string|null $message, string $messageTemplate = null, array $messageParameters = array(), int $messagePluralization = null, mixed $cause = null)
Any array key in $messageParameters will be used as a placeholder in $messageTemplate.
setOrigin(FormInterface $origin)
Sets the form that caused this error.
This method must only be called once.