2

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?

Karol Sikora
  • 522
  • 1
  • 4
  • 11

1 Answers1

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