src/Entity/Calendario.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9. * @ORM\Entity
  10. * @ORM\Table(name="calendario")
  11. */
  12. class Calendario
  13. {
  14. /**
  15. * @ORM\Id
  16. * @ORM\Column(type="integer")
  17. * @ORM\GeneratedValue(strategy="AUTO")
  18. */
  19. private $id;
  20. /**
  21. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  22. */
  23. private $deletedAt;
  24. /**
  25. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2024-01-01 00:00:00"})
  26. * @Gedmo\Timestampable(on="update")
  27. */
  28. private $updatedAt;
  29. /**
  30. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
  31. * @Gedmo\Timestampable(on="create")
  32. */
  33. private $createdAt;
  34. /**
  35. * @ORM\OneToMany(targetEntity=\App\Entity\Evento::class, mappedBy="calendario")
  36. */
  37. private $eventos;
  38. /**
  39. * @ORM\ManyToOne(targetEntity=\App\Entity\EntidadColaboradora::class, inversedBy="calendario")
  40. * @ORM\JoinColumn(name="entidad_colaboradora_id", referencedColumnName="id")
  41. */
  42. private $entidadColaboradora;
  43. public function __construct()
  44. {
  45. $this->eventos = new ArrayCollection();
  46. }
  47. public function getId(): ?int
  48. {
  49. return $this->id;
  50. }
  51. public function setId($id)
  52. {
  53. $this->id = $id;
  54. return $this;
  55. }
  56. public function getDeletedAt(): ?\DateTimeInterface
  57. {
  58. return $this->deletedAt;
  59. }
  60. public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  61. {
  62. $this->deletedAt = $deletedAt;
  63. return $this;
  64. }
  65. public function getUpdatedAt(): ?\DateTimeInterface
  66. {
  67. return $this->updatedAt;
  68. }
  69. public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  70. {
  71. $this->updatedAt = $updatedAt;
  72. return $this;
  73. }
  74. public function getCreatedAt(): ?\DateTimeInterface
  75. {
  76. return $this->createdAt;
  77. }
  78. public function setCreatedAt(\DateTimeInterface $createdAt): static
  79. {
  80. $this->createdAt = $createdAt;
  81. return $this;
  82. }
  83. /**
  84. * @return Collection<int, Evento>
  85. */
  86. public function getEventos(): Collection
  87. {
  88. return $this->eventos;
  89. }
  90. public function addEvento(Evento $evento): static
  91. {
  92. if (!$this->eventos->contains($evento)) {
  93. $this->eventos->add($evento);
  94. $evento->setCalendario($this);
  95. }
  96. return $this;
  97. }
  98. public function removeEvento(Evento $evento): static
  99. {
  100. if ($this->eventos->removeElement($evento)) {
  101. // set the owning side to null (unless already changed)
  102. if ($evento->getCalendario() === $this) {
  103. $evento->setCalendario(null);
  104. }
  105. }
  106. return $this;
  107. }
  108. public function getEntidadColaboradora(): ?EntidadColaboradora
  109. {
  110. return $this->entidadColaboradora;
  111. }
  112. public function setEntidadColaboradora(?EntidadColaboradora $entidadColaboradora): static
  113. {
  114. $this->entidadColaboradora = $entidadColaboradora;
  115. return $this;
  116. }
  117. }