constraint-mapping.yml 920 B

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