src/Core/Entity/Seguidor.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Core\Entity;
  3. use App\Core\Entity\User;
  4. use App\Core\Repository\SeguidorRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity(repositoryClass=SeguidorRepository::class)
  8. */
  9. class Seguidor
  10. {
  11. const JSON_FIELDS = ['id', 'seguidor' => User::JSON_FIELDS, 'seguido' => User::JSON_FIELDS];
  12. /**
  13. * @ORM\Id()
  14. * @ORM\GeneratedValue()
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\ManyToOne(targetEntity=User::class, inversedBy="seguidos")
  20. * @ORM\JoinColumn(nullable=false)
  21. */
  22. private $seguidor;
  23. /**
  24. * @ORM\ManyToOne(targetEntity=User::class, inversedBy="seguidores")
  25. * @ORM\JoinColumn(nullable=false)
  26. */
  27. private $seguido;
  28. public function getId(): ?int
  29. {
  30. return $this->id;
  31. }
  32. public function getSeguidor(): ?User
  33. {
  34. return $this->seguidor;
  35. }
  36. public function setSeguidor(?User $seguidor): self
  37. {
  38. $this->seguidor = $seguidor;
  39. return $this;
  40. }
  41. public function getSeguido(): ?User
  42. {
  43. return $this->seguido;
  44. }
  45. public function setSeguido(?User $seguido): self
  46. {
  47. $this->seguido = $seguido;
  48. return $this;
  49. }
  50. }