FormError (Component\Form)
Symfony\Component\Form\FormError
class FormError implements Serializable
Wraps errors in forms.
Methods
__construct(string $message, string|null $messageTemplate = null, array $messageParameters = array(), int|null $messagePluralization = null, mixed $cause = null) Constructor. | ||
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. | |
setOrigin(FormInterface $origin) Sets the form that caused this error. | ||
FormInterface | getOrigin() Returns the form that caused this error. | |
string | serialize() Serializes this error. | |
unserialize(string $serialized) Unserializes a serialized error. |
Details
public __construct(string $message, string|null $messageTemplate = null, array $messageParameters = array(), int|null $messagePluralization = null, mixed $cause = null)
Constructor.
Any array key in $messageParameters will be used as a placeholder in $messageTemplate.
public string getMessage()
Returns the error message.
public string getMessageTemplate()
Returns the error message template.
public array getMessageParameters()
Returns the parameters to be inserted in the message template.
public int|null getMessagePluralization()
Returns the value for error message pluralization.
public mixed getCause()
Returns the cause of this error.
public setOrigin(FormInterface $origin)
Sets the form that caused this error.
This method must only be called once.
public FormInterface getOrigin()
Returns the form that caused this error.
public string serialize()
Serializes this error.
public unserialize(string $serialized)
Unserializes a serialized error.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/Form/FormError.html