A
A
Alexander Evgenievich2015-02-20 18:36:56
PHP
Alexander Evgenievich, 2015-02-20 18:36:56

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

1 answer(s)
S
Sergey Senkevich, 2015-02-20
@banderos120

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 question

Ask a Question

731 491 924 answers to any question