MaxLength.php 773 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 MaxLength extends Constraint
  14. {
  15. public $message = 'This value is too long. It should have {{ limit }} characters or less';
  16. public $limit;
  17. public $charset = 'UTF-8';
  18. /**
  19. * {@inheritDoc}
  20. */
  21. public function getDefaultOption()
  22. {
  23. return 'limit';
  24. }
  25. /**
  26. * {@inheritDoc}
  27. */
  28. public function getRequiredOptions()
  29. {
  30. return array('limit');
  31. }
  32. }