Choice.php 936 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. class Choice extends \Symfony\Component\Validator\Constraint
  12. {
  13. public $choices;
  14. public $callback;
  15. public $multiple = false;
  16. public $min = null;
  17. public $max = null;
  18. public $message = 'This value should be one of the given choices';
  19. public $minMessage = 'You should select at least {{ limit }} choices';
  20. public $maxMessage = 'You should select at most {{ limit }} choices';
  21. /**
  22. * {@inheritDoc}
  23. */
  24. public function getDefaultOption()
  25. {
  26. return 'choices';
  27. }
  28. /**
  29. * {@inheritDoc}
  30. */
  31. public function getTargets()
  32. {
  33. return self::PROPERTY_CONSTRAINT;
  34. }
  35. }