src/Entity/Cliente.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClienteRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=ClienteRepository::class)
  9. */
  10. class Cliente
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="string", length=255)
  20. */
  21. private $nombre;
  22. /**
  23. * @ORM\ManyToOne(targetEntity=Country::class, inversedBy="clientes")
  24. * @ORM\JoinColumn(nullable=false)
  25. */
  26. private $country;
  27. /**
  28. * @ORM\ManyToOne(targetEntity=AcuerdoNivelServicio::class, inversedBy="clientes")
  29. * @ORM\JoinColumn(nullable=false)
  30. */
  31. private $AcuerdoNivelServicio;
  32. /**
  33. * @ORM\OneToMany(targetEntity=Ticket::class, mappedBy="Cliente")
  34. */
  35. private $tickets;
  36. /**
  37. * @ORM\Column(type="string", length=255, unique=true)
  38. */
  39. private string $token;
  40. public function __construct()
  41. {
  42. $this->tickets = new ArrayCollection();
  43. }
  44. public function getId(): ?int
  45. {
  46. return $this->id;
  47. }
  48. public function getNombre(): ?string
  49. {
  50. return $this->nombre;
  51. }
  52. public function setNombre(string $nombre): self
  53. {
  54. $this->nombre = $nombre;
  55. return $this;
  56. }
  57. public function getCountry(): ?Country
  58. {
  59. return $this->country;
  60. }
  61. public function setCountry(?Country $country): self
  62. {
  63. $this->country = $country;
  64. return $this;
  65. }
  66. public function getAcuerdoNivelServicio(): ?AcuerdoNivelServicio
  67. {
  68. return $this->AcuerdoNivelServicio;
  69. }
  70. public function setAcuerdoNivelServicio(?AcuerdoNivelServicio $AcuerdoNivelServicio): self
  71. {
  72. $this->AcuerdoNivelServicio = $AcuerdoNivelServicio;
  73. return $this;
  74. }
  75. /**
  76. * @return Collection<int, Ticket>
  77. */
  78. public function getTickets(): Collection
  79. {
  80. return $this->tickets;
  81. }
  82. public function addTicket(Ticket $ticket): self
  83. {
  84. if (!$this->tickets->contains($ticket)) {
  85. $this->tickets[] = $ticket;
  86. $ticket->setCliente($this);
  87. }
  88. return $this;
  89. }
  90. public function removeTicket(Ticket $ticket): self
  91. {
  92. if ($this->tickets->removeElement($ticket)) {
  93. // set the owning side to null (unless already changed)
  94. if ($ticket->getCliente() === $this) {
  95. $ticket->setCliente(null);
  96. }
  97. }
  98. return $this;
  99. }
  100. public function getToken(): string
  101. {
  102. return $this->token;
  103. }
  104. public function setToken(string $token): self
  105. {
  106. $this->token = $token;
  107. return $this;
  108. }
  109. }