constraint-mapping.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. namespaces:
  2. custom: Symfony\Tests\Component\Validator\Fixtures\
  3. Symfony\Tests\Component\Validator\Fixtures\Entity:
  4. group_sequence:
  5. - Foo
  6. - Entity
  7. constraints:
  8. # Custom constraint
  9. - Symfony\Tests\Component\Validator\Fixtures\ConstraintA: ~
  10. # Custom constraint with namespaces prefix
  11. - "custom:ConstraintB": ~
  12. properties:
  13. firstName:
  14. # Constraint without value
  15. - NotNull: ~
  16. # Constraint with single value
  17. - Min: 3
  18. # Constraint with multiple values
  19. - Choice: [A, B]
  20. # Constraint with child constraints
  21. - All:
  22. - NotNull: ~
  23. - Min: 3
  24. # Option with child constraints
  25. - All:
  26. constraints:
  27. - NotNull: ~
  28. - Min: 3
  29. # Value with child constraints
  30. - Collection:
  31. fields:
  32. foo:
  33. - NotNull: ~
  34. - Min: 3
  35. bar:
  36. - Min: 5
  37. # Constraint with options
  38. - Choice: { choices: [A, B], message: Must be one of %choices% }
  39. getters:
  40. lastName:
  41. - NotNull: ~