Commit | Line | Data |
---|---|---|
dec6d031 JB |
1 | <?php |
2 | namespace App\Entity; | |
3 | ||
4 | use Doctrine\ORM\Mapping as ORM; | |
84fd6c7f | 5 | use JMS\Serializer\Annotation as Serializer; |
dec6d031 JB |
6 | |
7 | /** | |
8 | * @ORM\Entity() | |
9 | * @ORM\Table(name="Friendship"); | |
84fd6c7f | 10 | * @Serializer\ExclusionPolicy("all") |
dec6d031 JB |
11 | */ |
12 | class Friendship | |
13 | { | |
14 | /** | |
15 | * @ORM\Id | |
3d47ccc8 | 16 | * @ORM\ManyToOne(targetEntity="Person", inversedBy="friends") |
dec6d031 JB |
17 | */ |
18 | protected $person; | |
19 | ||
20 | /** | |
21 | * @ORM\Id | |
3d47ccc8 | 22 | * @ORM\ManyToOne(targetEntity="Person", inversedBy="friends_with_me") |
84fd6c7f | 23 | * @Serializer\Expose |
dec6d031 JB |
24 | */ |
25 | protected $friend; | |
26 | ||
27 | /** | |
28 | * @ORM\Column(type="boolean", options={"default":false}) | |
84fd6c7f | 29 | * @Serializer\Expose |
dec6d031 JB |
30 | */ |
31 | protected $is_valid; | |
32 | ||
33 | public function getPerson() { | |
34 | return $this->person; | |
35 | } | |
36 | ||
37 | public function setPerson($person) { | |
38 | $this->person = $person; | |
39 | return $this; | |
40 | } | |
41 | ||
42 | public function getFriend() { | |
43 | return $this->friend; | |
44 | } | |
45 | ||
46 | public function setFriend($friend) { | |
47 | $this->friend = $friend; | |
48 | return $this; | |
49 | } | |
50 | ||
51 | public function getIsValid() { | |
52 | return $this->is_valid; | |
53 | } | |
54 | ||
55 | public function setIsValid($is_valid) { | |
56 | $this->is_valid = $is_valid; | |
57 | return $this; | |
58 | } | |
59 | } |