constraint-mapping.yml 1.0 KB

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