4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Validator\Tests\Fixtures;
14 use Symfony\Component\Validator\Constraints as Assert;
15 use Symfony\Component\Validator\Context\ExecutionContextInterface;
18 * @Symfony\Component\Validator\Tests\Fixtures\ConstraintA
19 * @Assert\GroupSequence({"Foo", "Entity"})
20 * @Assert\Callback({"Symfony\Component\Validator\Tests\Fixtures\CallbackClass", "callback"})
22 class Entity extends EntityParent implements EntityInterfaceB
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)
33 * @Assert\Choice(choices={"A", "B"}, message="Must be one of %choices%")
48 public $data = 'Overridden data';
49 public $initialized = false;
51 public function __construct($internal = null)
53 $this->internal = $internal;
56 public function getInternal()
58 return $this->internal.' from getter';
61 public function setLastName($lastName)
63 $this->lastName = $lastName;
69 public function getLastName()
71 return $this->lastName;
74 public function getValid()
81 public function isValid()
89 public function hasPermissions()
94 public function getData()
96 return 'Overridden data';
100 * @Assert\Callback(payload="foo")
102 public function validateMe(ExecutionContextInterface $context)
109 public static function validateMeStatic($object, ExecutionContextInterface $context)
116 public function getChildA()
118 return $this->childA;
122 * @param mixed $childA
124 public function setChildA($childA)
126 $this->childA = $childA;
132 public function getChildB()
134 return $this->childB;
138 * @param mixed $childB
140 public function setChildB($childB)
142 $this->childB = $childB;