Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / validator / Tests / Fixtures / Entity.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\Tests\Fixtures;
13
14 use Symfony\Component\Validator\Constraints as Assert;
15 use Symfony\Component\Validator\Context\ExecutionContextInterface;
16
17 /**
18  * @Symfony\Component\Validator\Tests\Fixtures\ConstraintA
19  * @Assert\GroupSequence({"Foo", "Entity"})
20  * @Assert\Callback({"Symfony\Component\Validator\Tests\Fixtures\CallbackClass", "callback"})
21  */
22 class Entity extends EntityParent implements EntityInterfaceB
23 {
24     /**
25      * @Assert\NotNull
26      * @Assert\Range(min=3)
27      * @Assert\All({@Assert\NotNull, @Assert\Range(min=3)}),
28      * @Assert\All(constraints={@Assert\NotNull, @Assert\Range(min=3)})
29      * @Assert\Collection(fields={
30      *   "foo" = {@Assert\NotNull, @Assert\Range(min=3)},
31      *   "bar" = @Assert\Range(min=5)
32      * })
33      * @Assert\Choice(choices={"A", "B"}, message="Must be one of %choices%")
34      */
35     public $firstName;
36     /**
37      * @Assert\Valid
38      */
39     public $childA;
40     /**
41      * @Assert\Valid
42      */
43     public $childB;
44     protected $lastName;
45     public $reference;
46     public $reference2;
47     private $internal;
48     public $data = 'Overridden data';
49     public $initialized = false;
50
51     public function __construct($internal = null)
52     {
53         $this->internal = $internal;
54     }
55
56     public function getInternal()
57     {
58         return $this->internal.' from getter';
59     }
60
61     public function setLastName($lastName)
62     {
63         $this->lastName = $lastName;
64     }
65
66     /**
67      * @Assert\NotNull
68      */
69     public function getLastName()
70     {
71         return $this->lastName;
72     }
73
74     public function getValid()
75     {
76     }
77
78     /**
79      * @Assert\IsTrue
80      */
81     public function isValid()
82     {
83         return 'valid';
84     }
85
86     /**
87      * @Assert\IsTrue
88      */
89     public function hasPermissions()
90     {
91         return 'permissions';
92     }
93
94     public function getData()
95     {
96         return 'Overridden data';
97     }
98
99     /**
100      * @Assert\Callback(payload="foo")
101      */
102     public function validateMe(ExecutionContextInterface $context)
103     {
104     }
105
106     /**
107      * @Assert\Callback
108      */
109     public static function validateMeStatic($object, ExecutionContextInterface $context)
110     {
111     }
112
113     /**
114      * @return mixed
115      */
116     public function getChildA()
117     {
118         return $this->childA;
119     }
120
121     /**
122      * @param mixed $childA
123      */
124     public function setChildA($childA)
125     {
126         $this->childA = $childA;
127     }
128
129     /**
130      * @return mixed
131      */
132     public function getChildB()
133     {
134         return $this->childB;
135     }
136
137     /**
138      * @param mixed $childB
139      */
140     public function setChildB($childB)
141     {
142         $this->childB = $childB;
143     }
144 }