Drupal investigation

Expression.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. /**
  13. * @Annotation
  14. * @Target({"CLASS", "PROPERTY", "METHOD", "ANNOTATION"})
  15. *
  16. * @author Fabien Potencier <fabien@symfony.com>
  17. * @author Bernhard Schussek <bschussek@gmail.com>
  18. */
  19. class Expression extends Constraint
  20. {
  21. const EXPRESSION_FAILED_ERROR = '6b3befbc-2f01-4ddf-be21-b57898905284';
  22. protected static $errorNames = array(
  23. self::EXPRESSION_FAILED_ERROR => 'EXPRESSION_FAILED_ERROR',
  24. );
  25. public $message = 'This value is not valid.';
  26. public $expression;
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function getDefaultOption()
  31. {
  32. return 'expression';
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function getRequiredOptions()
  38. {
  39. return array('expression');
  40. }
  41. /**
  42. * {@inheritdoc}
  43. */
  44. public function getTargets()
  45. {
  46. return array(self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT);
  47. }
  48. /**
  49. * {@inheritdoc}
  50. */
  51. public function validatedBy()
  52. {
  53. return 'validator.expression';
  54. }
  55. }