src/Entity/ExpedientePerteneAEntidad.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="expediente_pertenece_a_entidad")
  11. */
  12. class ExpedientePerteneAEntidad extends \App\Entity\BaseEntity
  13. {
  14. /**
  15. * @ORM\Id
  16. * @ORM\Column(type="integer")
  17. * @ORM\GeneratedValue(strategy="AUTO")
  18. */
  19. private $id;
  20. /**
  21. * @ORM\Column(type="string", nullable=true, name="id_externo")
  22. */
  23. private $idExterno;
  24. /**
  25. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
  26. * @Gedmo\Timestampable(on="create")
  27. */
  28. private $createdAt;
  29. /**
  30. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2024-01-01 00:00:00"})
  31. * @Gedmo\Timestampable(on="update")
  32. */
  33. private $updatedAt;
  34. /**
  35. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  36. */
  37. private $deletedAt;
  38. /**
  39. * @ORM\OneToMany(targetEntity=\App\Entity\Expediente::class, mappedBy="expedientePerteneAEntidad")
  40. */
  41. private $expedientes;
  42. /**
  43. * @ORM\ManyToOne(targetEntity=\App\Entity\EntidadColaboradora::class, inversedBy="expedientePerteneAEntidads")
  44. * @ORM\JoinColumn(name="entidad_colaboradora_id", referencedColumnName="id")
  45. */
  46. private $entidadColaboradora;
  47. public function __construct()
  48. {
  49. $this->expedientes = new ArrayCollection();
  50. }
  51. public function getId(): ?int
  52. {
  53. return $this->id;
  54. }
  55. public function setId($id)
  56. {
  57. $this->id = $id;
  58. return $this;
  59. }
  60. public function getIdExterno(): ?string
  61. {
  62. return $this->idExterno;
  63. }
  64. public function setIdExterno(?string $idExterno): static
  65. {
  66. $this->idExterno = $idExterno;
  67. return $this;
  68. }
  69. public function getCreatedAt(): ?\DateTimeInterface
  70. {
  71. return $this->createdAt;
  72. }
  73. public function setCreatedAt(\DateTimeInterface $createdAt): static
  74. {
  75. $this->createdAt = $createdAt;
  76. return $this;
  77. }
  78. public function getUpdatedAt(): ?\DateTimeInterface
  79. {
  80. return $this->updatedAt;
  81. }
  82. public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  83. {
  84. $this->updatedAt = $updatedAt;
  85. return $this;
  86. }
  87. public function getDeletedAt(): ?\DateTimeInterface
  88. {
  89. return $this->deletedAt;
  90. }
  91. public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  92. {
  93. $this->deletedAt = $deletedAt;
  94. return $this;
  95. }
  96. public function getEntidadColaboradora(): ?EntidadColaboradora
  97. {
  98. return $this->entidadColaboradora;
  99. }
  100. public function setEntidadColaboradora(?EntidadColaboradora $entidadColaboradora): static
  101. {
  102. $this->entidadColaboradora = $entidadColaboradora;
  103. return $this;
  104. }
  105. /**
  106. * @return Collection<int, Expediente>
  107. */
  108. public function getExpedientes(): Collection
  109. {
  110. return $this->expedientes;
  111. }
  112. public function addExpediente(Expediente $expediente): static
  113. {
  114. if (!$this->expedientes->contains($expediente)) {
  115. $this->expedientes->add($expediente);
  116. $expediente->setExpedientePerteneAEntidad($this);
  117. }
  118. return $this;
  119. }
  120. public function removeExpediente(Expediente $expediente): static
  121. {
  122. if ($this->expedientes->removeElement($expediente)) {
  123. // set the owning side to null (unless already changed)
  124. if ($expediente->getExpedientePerteneAEntidad() === $this) {
  125. $expediente->setExpedientePerteneAEntidad(null);
  126. }
  127. }
  128. return $this;
  129. }
  130. }