Cascade.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. * @Target({"CLASS"})
  16. *
  17. * @author Jules Pietri <jules@heahprod.com>
  18. */
  19. #[\Attribute(\Attribute::TARGET_CLASS)]
  20. class Cascade extends Constraint
  21. {
  22. public function __construct(array $options = null)
  23. {
  24. if (\is_array($options) && \array_key_exists('groups', $options)) {
  25. throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__));
  26. }
  27. parent::__construct($options);
  28. }
  29. /**
  30. * {@inheritdoc}
  31. */
  32. public function getTargets()
  33. {
  34. return self::CLASS_CONSTRAINT;
  35. }
  36. }