| 1 | <?php |
| 2 | namespace App\Entity; |
| 3 | |
| 4 | use Doctrine\ORM\Mapping as ORM; |
| 5 | use JMS\Serializer\Annotation as Serializer; |
| 6 | |
| 7 | /** |
| 8 | * @ORM\Entity() |
| 9 | * @ORM\Table(name="Friendship"); |
| 10 | * @Serializer\ExclusionPolicy("all") |
| 11 | */ |
| 12 | class Friendship |
| 13 | { |
| 14 | /** |
| 15 | * @ORM\Id |
| 16 | * @ORM\ManyToOne(targetEntity="Person", inversedBy="friends") |
| 17 | */ |
| 18 | protected $person; |
| 19 | |
| 20 | /** |
| 21 | * @ORM\Id |
| 22 | * @ORM\ManyToOne(targetEntity="Person", inversedBy="friends_with_me") |
| 23 | * @Serializer\Expose |
| 24 | */ |
| 25 | protected $friend; |
| 26 | |
| 27 | /** |
| 28 | * @ORM\Column(type="boolean", options={"default":false}) |
| 29 | * @Serializer\Expose |
| 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 | } |