db backup prior to drupal security update
[yaffs-website] / vendor / symfony / validator / Constraints / AbstractComparison.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  * Used for the comparison of values.
19  *
20  * @author Daniel Holmes <daniel@danielholmes.org>
21  * @author Bernhard Schussek <bschussek@gmail.com>
22  */
23 abstract class AbstractComparison extends Constraint
24 {
25     public $message;
26     public $value;
27
28     /**
29      * {@inheritdoc}
30      */
31     public function __construct($options = null)
32     {
33         if (is_array($options) && !isset($options['value'])) {
34             throw new ConstraintDefinitionException(sprintf(
35                 'The %s constraint requires the "value" option to be set.',
36                 get_class($this)
37             ));
38         }
39
40         parent::__construct($options);
41     }
42
43     /**
44      * {@inheritdoc}
45      */
46     public function getDefaultOption()
47     {
48         return 'value';
49     }
50 }