src/Entity/Convocatoria.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="convocatoria")
  11. */
  12. class Convocatoria 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\Column(type="string", nullable=true)
  40. */
  41. private $nombre;
  42. /**
  43. * @ORM\Column(type="boolean", nullable=false, options={"default":false})
  44. */
  45. private ?bool $activa = false;
  46. /**
  47. * @ORM\OneToMany(targetEntity=\App\Entity\Expediente::class, mappedBy="convocatoria")
  48. */
  49. private $expedientes;
  50. public function __construct()
  51. {
  52. $this->expedientes = new ArrayCollection();
  53. }
  54. public function getId(): ?int
  55. {
  56. return $this->id;
  57. }
  58. public function setId($id)
  59. {
  60. $this->id = $id;
  61. return $this;
  62. }
  63. public function getIdExterno(): ?string
  64. {
  65. return $this->idExterno;
  66. }
  67. public function setIdExterno(?string $idExterno): static
  68. {
  69. $this->idExterno = $idExterno;
  70. return $this;
  71. }
  72. public function getCreatedAt(): ?\DateTimeInterface
  73. {
  74. return $this->createdAt;
  75. }
  76. public function setCreatedAt(\DateTimeInterface $createdAt): static
  77. {
  78. $this->createdAt = $createdAt;
  79. return $this;
  80. }
  81. public function getUpdatedAt(): ?\DateTimeInterface
  82. {
  83. return $this->updatedAt;
  84. }
  85. public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  86. {
  87. $this->updatedAt = $updatedAt;
  88. return $this;
  89. }
  90. public function getDeletedAt(): ?\DateTimeInterface
  91. {
  92. return $this->deletedAt;
  93. }
  94. public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  95. {
  96. $this->deletedAt = $deletedAt;
  97. return $this;
  98. }
  99. /**
  100. * @return Collection<int, Expediente>
  101. */
  102. public function getExpedientes(): Collection
  103. {
  104. return $this->expedientes;
  105. }
  106. public function addExpediente(Expediente $expediente): static
  107. {
  108. if (!$this->expedientes->contains($expediente)) {
  109. $this->expedientes->add($expediente);
  110. $expediente->setConvocatoria($this);
  111. }
  112. return $this;
  113. }
  114. public function removeExpediente(Expediente $expediente): static
  115. {
  116. if ($this->expedientes->removeElement($expediente)) {
  117. // set the owning side to null (unless already changed)
  118. if ($expediente->getConvocatoria() === $this) {
  119. $expediente->setConvocatoria(null);
  120. }
  121. }
  122. return $this;
  123. }
  124. public function getNombre(): ?string
  125. {
  126. return $this->nombre;
  127. }
  128. public function setNombre(?string $nombre): static
  129. {
  130. $this->nombre = $nombre;
  131. return $this;
  132. }
  133. public function isActiva(): ?bool
  134. {
  135. return $this->activa;
  136. }
  137. public function setActiva(?bool $activa): static
  138. {
  139. $this->activa = $activa;
  140. return $this;
  141. }
  142. public function getIdentificador(): ?string
  143. {
  144. return $this->getData()['identificador'] ?? null;
  145. }
  146. }