Drupal investigation

Traverse.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
  13. /**
  14. * @Annotation
  15. *
  16. * @author Bernhard Schussek <bschussek@gmail.com>
  17. */
  18. class Traverse extends Constraint
  19. {
  20. public $traverse = true;
  21. public function __construct($options = null)
  22. {
  23. if (is_array($options) && array_key_exists('groups', $options)) {
  24. throw new ConstraintDefinitionException(sprintf(
  25. 'The option "groups" is not supported by the constraint %s',
  26. __CLASS__
  27. ));
  28. }
  29. parent::__construct($options);
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function getDefaultOption()
  35. {
  36. return 'traverse';
  37. }
  38. /**
  39. * {@inheritdoc}
  40. */
  41. public function getTargets()
  42. {
  43. return self::CLASS_CONSTRAINT;
  44. }
  45. }