Symfony\Component\Validator\ConstraintViolation::__construct
Creates a new constraint violation.
Signature
public function __construct(string
$message,
[string
$messageTemplate = null,
[array
$messageParameters = null,
[mixed
$root = null,
[string
$propertyPath = null,
[mixed
$invalidValue = null,
[integer|null
$messagePluralization = null,
[mixed
$code = null]]]]]]] )
Parameters
$message
—
string
- The violation message.
$messageTemplate
—
string
- The raw violation message.
$messageParameters
—
array
- The parameters to substitute
in the raw message.
$root
—
mixed
- The value originally passed
to the validator.
$propertyPath
—
string
- The property path from the
root value to the invalid
value.
$invalidValue
—
mixed
- The invalid value causing the
violation.
$messagePluralization
—
object
- The pluralization parameter.
$code
—
mixed
- The error code of the
violation, if any.