RequestValidator
class RequestValidator (View source)
Validates controller request data against Symfony constraints.
Holds the constraint set for the request so controllers can declare rules once and validate repeatedly; extra and missing fields are tolerated to match the permissive form handling of the web UI.
Methods
__construct()
No description
void
setConstraints(array $constraints)
Sets validation constraints for the request data.
void
setRules(array $rules)
Sets validation rules for the request data.
ConstraintViolationListInterface
validate(array $data)
Validates data and returns constraint violations.
string|null
firstErrorMessage(array $data)
Message of the first violation, or null when the data is valid.
Details
__construct()
No description
void
setConstraints(array $constraints)
Sets validation constraints for the request data.
void
setRules(array $rules)
Sets validation rules for the request data.
ConstraintViolationListInterface
validate(array $data)
Validates data and returns constraint violations.
string|null
firstErrorMessage(array $data)
Message of the first violation, or null when the data is valid.