Answer the question
In order to leave comments, you need to log in
How to validate ArrayCollection properties in Symfony2?
Hello.
How to write Assert to be able to validate ArrayCollection entity properties? These properties are used for One To Many or Many To One relationships.
Answer the question
In order to leave comments, you need to log in
If you want to validate related entities, then the validation rules must be written in their classes. And if you need to check the collection itself (number of elements, etc.), then look at the examples from the documentation . If the rules are more complicated, then you can use callback or expressions .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question