Constraint violation validation error.
Adapts ConstraintViolationInterface to ValidationError.
Methods¶
__construct()
¶
ConstraintViolationAdapter.php
:
37
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$violation | ConstraintViolationInterface | - | - |
getTarget()
¶
ConstraintViolationAdapter.php
:
56
Returns the target element on which the error occurred.
|
|
Return values
string
getTranslatableMessage()
¶
ConstraintViolationAdapter.php
:
43
Returns a translatable Message.
|
|
Return values
setTarget()
¶
ConstraintViolationAdapter.php
:
51
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 | mixed | - | - |