4572c9b2193c48d0e71546264e4aea4fedd6e5d5
[yaffs-website] / vendor / symfony / validator / Constraints / Traverse.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Validator\Constraints;
13
14 use Symfony\Component\Validator\Constraint;
15 use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
16
17 /**
18  * @Annotation
19  *
20  * @author Bernhard Schussek <bschussek@gmail.com>
21  */
22 class Traverse extends Constraint
23 {
24     public $traverse = true;
25
26     public function __construct($options = null)
27     {
28         if (\is_array($options) && array_key_exists('groups', $options)) {
29             throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint %s', __CLASS__));
30         }
31
32         parent::__construct($options);
33     }
34
35     /**
36      * {@inheritdoc}
37      */
38     public function getDefaultOption()
39     {
40         return 'traverse';
41     }
42
43     /**
44      * {@inheritdoc}
45      */
46     public function getTargets()
47     {
48         return self::CLASS_CONSTRAINT;
49     }
50 }