class ConstraintViolationBuilder implements ConstraintViolationBuilderInterface
Default implementation of {@link ConstraintViolationBuilderInterface}.
Methods
__construct(ConstraintViolationList $violations, Constraint $constraint, $message, array $parameters, $root, $propertyPath, $invalidValue, TranslatorInterface $translator, $translationDomain = null) | ||
ConstraintViolationBuilderInterface | atPath(string $path) Stores the property path at which the violation should be generated. | |
ConstraintViolationBuilderInterface | setParameter(string $key, string $value) Sets a parameter to be inserted into the violation message. | |
ConstraintViolationBuilderInterface | setParameters(array $parameters) Sets all parameters to be inserted into the violation message. | |
ConstraintViolationBuilderInterface | setTranslationDomain(string $translationDomain) Sets the translation domain which should be used for translating the violation message. | |
ConstraintViolationBuilderInterface | setInvalidValue(mixed $invalidValue) Sets the invalid value that caused this violation. | |
ConstraintViolationBuilderInterface | setPlural(int $number) Sets the number which determines how the plural form of the violation message is chosen when it is translated. | |
ConstraintViolationBuilderInterface | setCode(string|null $code) Sets the violation code. | |
ConstraintViolationBuilderInterface | setCause(mixed $cause) Sets the cause of the violation. | |
addViolation() Adds the violation to the current execution context. |
Details
__construct(ConstraintViolationList $violations, Constraint $constraint, $message, array $parameters, $root, $propertyPath, $invalidValue, TranslatorInterface $translator, $translationDomain = null)
ConstraintViolationBuilderInterface atPath(string $path)
Stores the property path at which the violation should be generated.
The passed path will be appended to the current property path of the execution context.
ConstraintViolationBuilderInterface setParameter(string $key, string $value)
Sets a parameter to be inserted into the violation message.
ConstraintViolationBuilderInterface setParameters(array $parameters)
Sets all parameters to be inserted into the violation message.
ConstraintViolationBuilderInterface setTranslationDomain(string $translationDomain)
Sets the translation domain which should be used for translating the violation message.
ConstraintViolationBuilderInterface setInvalidValue(mixed $invalidValue)
Sets the invalid value that caused this violation.
ConstraintViolationBuilderInterface setPlural(int $number)
Sets the number which determines how the plural form of the violation message is chosen when it is translated.
ConstraintViolationBuilderInterface setCode(string|null $code)
Sets the violation code.
ConstraintViolationBuilderInterface setCause(mixed $cause)
Sets the cause of the violation.
addViolation()
Adds the violation to the current execution context.
Please login to continue.