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