Choice.php 945 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Validator\Constraints;
  11. use Symfony\Component\Validator\Constraint;
  12. /** @Annotation */
  13. class Choice extends Constraint
  14. {
  15. public $choices;
  16. public $callback;
  17. public $multiple = false;
  18. public $strict = false;
  19. public $min = null;
  20. public $max = null;
  21. public $message = 'The value you selected is not a valid choice';
  22. public $multipleMessage = 'One or more of the given values is invalid';
  23. public $minMessage = 'You must select at least {{ limit }} choices';
  24. public $maxMessage = 'You must select at most {{ limit }} choices';
  25. /**
  26. * {@inheritDoc}
  27. */
  28. public function getDefaultOption()
  29. {
  30. return 'choices';
  31. }
  32. }