Regex.php 813 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 Regex extends \Symfony\Component\Validator\Constraint
  12. {
  13. public $message = 'This value is not valid';
  14. public $pattern;
  15. public $match = true;
  16. /**
  17. * {@inheritDoc}
  18. */
  19. public function getDefaultOption()
  20. {
  21. return 'pattern';
  22. }
  23. /**
  24. * {@inheritDoc}
  25. */
  26. public function getRequiredOptions()
  27. {
  28. return array('pattern');
  29. }
  30. /**
  31. * {@inheritDoc}
  32. */
  33. public function getTargets()
  34. {
  35. return self::PROPERTY_CONSTRAINT;
  36. }
  37. }