Interface for validation errors.
Enforces to return a translatable message, since it will be necessary to present validation errors to the user. Thus we need plural form handling and replacements of placeholders and so on.
Methods¶
getTarget() ¶
ValidationError.php
:
39
Returns the target element on which the error occurred.
|
|
Return values
string
getTranslatableMessage() ¶
Translatable.php
:
21
Returns a translatable Message.
|
|
Return values
setTarget() ¶
ValidationError.php
:
32
Sets the target element on which the error occurred.
|
|
E.g. Property of a Field value which didn't validate against validation. Can be a property path compatible with Symfony PropertyAccess component.
Examples:
- "[StringLengthValidator][minStringLength]" => Target is "minStringLength" key under "StringLengthValidator" key (fieldtype validator configuration)
- "my_field_definition_identifier"
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$target | string | - | - |