ConstraintViolationBuilderInterface::setTranslationDomain()

ConstraintViolationBuilderInterface setTranslationDomain(string $translationDomain) Sets the translation domain which should be used for translating the violation message. Parameters string $translationDomain The translation domain Return Value ConstraintViolationBuilderInterface This builder See also \Symfony\Component\Translation\TranslatorInterface

ConstraintViolationInterface

interface ConstraintViolationInterface A violation of a constraint that happened during validation. For each constraint that fails during validation one or more violations are created. The violations store the violation message, the path to the failing element in the validation graph and the root element that was originally passed to the validator. For example, take the following graph: (Person)---(firstName: string) \ (address: Address)---(street: string) If the Person object is va

ConstraintViolationBuilderInterface::atPath()

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. Parameters string $path The property path Return Value ConstraintViolationBuilderInterface This builder

ConstraintViolationBuilderInterface::setCode()

ConstraintViolationBuilderInterface setCode(string|null $code) Sets the violation code. Parameters string|null $code The violation code Return Value ConstraintViolationBuilderInterface This builder

ConstraintViolationBuilderInterface::setInvalidValue()

ConstraintViolationBuilderInterface setInvalidValue(mixed $invalidValue) Sets the invalid value that caused this violation. Parameters mixed $invalidValue The invalid value Return Value ConstraintViolationBuilderInterface This builder

ConstraintViolationBuilderInterface::setParameter()

ConstraintViolationBuilderInterface setParameter(string $key, string $value) Sets a parameter to be inserted into the violation message. Parameters string $key The name of the parameter string $value The value to be inserted in the parameter's place Return Value ConstraintViolationBuilderInterface This builder

ConstraintViolationBuilderInterface::setCause()

ConstraintViolationBuilderInterface setCause(mixed $cause) Sets the cause of the violation. Parameters mixed $cause The cause of the violation Return Value ConstraintViolationBuilderInterface This builder

ConstraintViolationBuilderInterface

interface ConstraintViolationBuilderInterface Builds {@link \Symfony\Component\Validator\ConstraintViolationInterface} objects. Use the various methods on this interface to configure the built violation. Finally, call {@link addViolation()} to add the violation to the current execution context. Methods ConstraintViolationBuilderInterface atPath(string $path) Stores the property path at which the violation should be generated. ConstraintViolationBuilderInterface setParameter(string $

ConstraintViolationBuilderInterface::addViolation()

addViolation() Adds the violation to the current execution context.

ConstraintViolationBuilder::setPlural()

ConstraintViolationBuilderInterface setPlural(int $number) Sets the number which determines how the plural form of the violation message is chosen when it is translated. Parameters int $number The number for determining the plural form Return Value ConstraintViolationBuilderInterface This builder