/
Entity.php
53 lines (44 loc) · 1.25 KB
/
Entity.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace Symfony\Tests\Component\Validator\Fixtures;
require_once __DIR__.'/EntityParent.php';
require_once __DIR__.'/EntityInterface.php';
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\GroupSequenceProviderInterface;
/**
* @Symfony\Tests\Component\Validator\Fixtures\ConstraintA
* @Assert\GroupSequence({"Foo", "Entity"})
*/
class Entity extends EntityParent implements EntityInterface
{
/**
* @Assert\NotNull
* @Assert\Min(3)
* @Assert\All({@Assert\NotNull, @Assert\Min(3)}),
* @Assert\All(constraints={@Assert\NotNull, @Assert\Min(3)})
* @Assert\Collection(fields={
* "foo" = {@Assert\NotNull, @Assert\Min(3)},
* "bar" = @Assert\Min(5)
* })
* @Assert\Choice(choices={"A", "B"}, message="Must be one of %choices%")
*/
protected $firstName;
protected $lastName;
public $reference;
protected $groups = array();
private $internal;
public function __construct($internal = null)
{
$this->internal = $internal;
}
public function getInternal()
{
return $this->internal . ' from getter';
}
/**
* @Assert\NotNull
*/
public function getLastName()
{
return $this->lastName;
}
}