validateValue(mixed $value, Constraint|Constraint[] $constraints, string $subPath = '', null|string|string[] $groups = null)
Validates a value against a constraint.
Use the parameter $subPath to adapt the property path for the validated value. For example, take the following object graph:
(Person)---($address: Address)---($street: string) ^
When the validator validates the Address instance, the property path stored in the execution context is "address". When you manually validate the property $street now, pass the sub path "street" to adapt the full property path to "address.street":
$context->validate($address->street, new NotNull(), 'street');
Please login to continue.