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\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%")
40 public $data = 'Overridden data';
41 public $initialized = false;
43 public function __construct($internal = null)
45 $this->internal = $internal;
48 public function getInternal()
50 return $this->internal.' from getter';
53 public function setLastName($lastName)
55 $this->lastName = $lastName;
61 public function getLastName()
63 return $this->lastName;
66 public function getValid()
73 public function isValid()
81 public function hasPermissions()
86 public function getData()
88 return 'Overridden data';
92 * @Assert\Callback(payload="foo")
94 public function validateMe(ExecutionContextInterface $context)
101 public static function validateMeStatic($object, ExecutionContextInterface $context)