I have found Symfony\Bundle\DoctrineMongoDBBundle\Validator\Constraints\Unique but it seems to be valid only for one field (found in this example: http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/form.html as class annotation). Is there any simple solution for such validation on more than one field?
Asked
Active
Viewed 2,794 times
2
-
Have you tried just adding the @MongoDBUnique annotation to the field instead of the class? – Jamie Sutherland Mar 29 '12 at 13:36
1 Answers
0
Yes, but i`ve found simple solution - just add more than one @MongoDBUnique constraint works. Remember to separate @MongoDBUnique for each unique field, nor combining all fields into array as in @UniqueEntity. –

Karol Sikora
- 522
- 1
- 4
- 11