8105a22be787dac15b0759c3305c729712db1707
[yaffs-website] / Constraint / TestFieldConstraint.php
1 <?php
2
3 namespace Drupal\field_test\Plugin\Validation\Constraint;
4
5 use Symfony\Component\Validator\Constraints\NotEqualTo;
6
7 /**
8  * Checks if a value is not equal.
9  *
10  * @Constraint(
11  *   id = "TestField",
12  *   label = @Translation("Test Field", context = "Validation"),
13  *   type = { "integer" }
14  * )
15  */
16 class TestFieldConstraint extends NotEqualTo {
17
18   /**
19    * {@inheritdoc}
20    */
21   public function getRequiredOptions() {
22     return ['value'];
23   }
24
25   /**
26    * {@inheritdoc}
27    */
28   public function validatedBy() {
29     return '\Symfony\Component\Validator\Constraints\NotEqualToValidator';
30   }
31
32 }