src/Entity/SolicitudAccionFormativa.php line 23

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. /**
  8. * @ORM\Entity
  9. * @ORM\Table(
  10. * name="solicitud_accion_formativa",
  11. * indexes={
  12. * @ORM\Index(name="idx_saf_curso", columns={"curso_id"}),
  13. * @ORM\Index(name="idx_saf_modalidad", columns={"modalidad_id"}),
  14. * @ORM\Index(name="idx_saf_expediente", columns={"expediente_id"}),
  15. * @ORM\Index(name="idx_saf_deleted_at", columns={"deleted_at"}),
  16. * @ORM\Index(name="idx_saf_updated_at", columns={"updated_at"})
  17. * }
  18. * )
  19. */
  20. class SolicitudAccionFormativa extends \App\Entity\BaseEntity
  21. {
  22. /**
  23. * @ORM\Id
  24. * @ORM\Column(type="integer")
  25. * @ORM\GeneratedValue(strategy="AUTO")
  26. */
  27. private $id;
  28. /**
  29. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  30. */
  31. private $deletedAt;
  32. /**
  33. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2024-01-01 00:00:00"})
  34. */
  35. private $updatedAt;
  36. /**
  37. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
  38. */
  39. private $createdAt;
  40. /**
  41. * @ORM\Column(type="string", nullable=true, name="id_externo")
  42. */
  43. private $idExterno;
  44. /**
  45. * @ORM\OneToMany(targetEntity=\App\Entity\Grupo::class, mappedBy="solicitudAccionFormativa")
  46. */
  47. private $grupos;
  48. /**
  49. * @ORM\ManyToOne(targetEntity=\App\Entity\Curso::class, inversedBy="solicitudAccionFormativas")
  50. * @ORM\JoinColumn(name="curso_id", referencedColumnName="id")
  51. */
  52. private $curso;
  53. /**
  54. * @ORM\ManyToOne(targetEntity=\App\Entity\Expediente::class, inversedBy="solicitudAccionFormativas")
  55. * @ORM\JoinColumn(name="expediente_id", referencedColumnName="id")
  56. */
  57. private $expediente;
  58. /**
  59. * @ORM\ManyToOne(targetEntity=\App\Entity\Modalidad::class, inversedBy="solicitudAccionFormativas")
  60. * @ORM\JoinColumn(name="modalidad_id", referencedColumnName="id")
  61. */
  62. private $modalidad;
  63. /**
  64. * @ORM\ManyToMany(targetEntity=\App\Entity\UsuarioHermes::class, mappedBy="solicitudesInteres")
  65. */
  66. private $usuarioHermesInteres;
  67. /**
  68. * @ORM\ManyToMany(targetEntity=\App\Entity\UsuarioHermes::class, mappedBy="solicitudesFavorito")
  69. */
  70. private $usuarioHermesFavorito;
  71. public function __construct()
  72. {
  73. $this->grupos = new ArrayCollection();
  74. $this->usuarioHermesFavorito = new ArrayCollection();
  75. $this->usuarioHermesInteres = new ArrayCollection();
  76. }
  77. public function getId(): ?int
  78. {
  79. return $this->id;
  80. }
  81. public function setId($id)
  82. {
  83. $this->id = $id;
  84. return $this;
  85. }
  86. public function getDeletedAt(): ?\DateTimeInterface
  87. {
  88. return $this->deletedAt;
  89. }
  90. public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  91. {
  92. $this->deletedAt = $deletedAt;
  93. return $this;
  94. }
  95. public function getUpdatedAt(): ?\DateTimeInterface
  96. {
  97. return $this->updatedAt;
  98. }
  99. public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  100. {
  101. $this->updatedAt = $updatedAt;
  102. return $this;
  103. }
  104. public function getCreatedAt(): ?\DateTimeInterface
  105. {
  106. return $this->createdAt;
  107. }
  108. public function setCreatedAt(\DateTimeInterface $createdAt): static
  109. {
  110. $this->createdAt = $createdAt;
  111. return $this;
  112. }
  113. public function getIdExterno(): ?string
  114. {
  115. return $this->idExterno;
  116. }
  117. public function setIdExterno(?string $idExterno): static
  118. {
  119. $this->idExterno = $idExterno;
  120. return $this;
  121. }
  122. /**
  123. * @return Collection<int, Grupo>
  124. */
  125. public function getGrupos(): Collection
  126. {
  127. return $this->grupos;
  128. }
  129. public function addGrupo(Grupo $grupo): static
  130. {
  131. if (!$this->grupos->contains($grupo)) {
  132. $this->grupos->add($grupo);
  133. $grupo->setSolicitudAccionFormativa($this);
  134. }
  135. return $this;
  136. }
  137. public function removeGrupo(Grupo $grupo): static
  138. {
  139. if ($this->grupos->removeElement($grupo)) {
  140. // set the owning side to null (unless already changed)
  141. if ($grupo->getSolicitudAccionFormativa() === $this) {
  142. $grupo->setSolicitudAccionFormativa(null);
  143. }
  144. }
  145. return $this;
  146. }
  147. public function getCurso(): ?Curso
  148. {
  149. return $this->curso;
  150. }
  151. public function setCurso(?Curso $curso): static
  152. {
  153. $this->curso = $curso;
  154. return $this;
  155. }
  156. public function getExpediente(): ?Expediente
  157. {
  158. return $this->expediente;
  159. }
  160. public function setExpediente(?Expediente $expediente): static
  161. {
  162. $this->expediente = $expediente;
  163. return $this;
  164. }
  165. public function getModalidad(): ?Modalidad
  166. {
  167. return $this->modalidad;
  168. }
  169. public function setModalidad(?Modalidad $modalidad): static
  170. {
  171. $this->modalidad = $modalidad;
  172. return $this;
  173. }
  174. /**
  175. * @return Collection<int, UsuarioHermes>
  176. */
  177. public function getUsuarioHermesFavorito(): Collection
  178. {
  179. return $this->usuarioHermesFavorito;
  180. }
  181. public function addUsuarioHermesFavorito(UsuarioHermes $usuarioHermesFavorito): static
  182. {
  183. if (!$this->usuarioHermesFavorito->contains($usuarioHermesFavorito)) {
  184. $this->usuarioHermesFavorito->add($usuarioHermesFavorito);
  185. $usuarioHermesFavorito->addSolicitudesFavorito($this);
  186. }
  187. return $this;
  188. }
  189. public function removeUsuarioHermesFavorito(UsuarioHermes $usuarioHermesFavorito): static
  190. {
  191. if ($this->usuarioHermesFavorito->removeElement($usuarioHermesFavorito)) {
  192. $usuarioHermesFavorito->removeSolicitudesFavorito($this);
  193. }
  194. return $this;
  195. }
  196. /**
  197. * @return Collection<int, UsuarioHermes>
  198. */
  199. public function getUsuarioHermesInteres(): Collection
  200. {
  201. return $this->usuarioHermesInteres;
  202. }
  203. public function addUsuarioHermesIntere(UsuarioHermes $usuarioHermesIntere): static
  204. {
  205. if (!$this->usuarioHermesInteres->contains($usuarioHermesIntere)) {
  206. $this->usuarioHermesInteres->add($usuarioHermesIntere);
  207. $usuarioHermesIntere->addSolicitudesIntere($this);
  208. }
  209. return $this;
  210. }
  211. public function removeUsuarioHermesIntere(UsuarioHermes $usuarioHermesIntere): static
  212. {
  213. if ($this->usuarioHermesInteres->removeElement($usuarioHermesIntere)) {
  214. $usuarioHermesIntere->removeSolicitudesIntere($this);
  215. }
  216. return $this;
  217. }
  218. /**
  219. * @ORM\Column(type="integer", nullable=true)
  220. */
  221. private $horasAulaVirtual = 0;
  222. /**
  223. * @ORM\Column(type="integer", nullable=true)
  224. */
  225. private $horasPresenciales = 0;
  226. /**
  227. * @ORM\Column(type="integer", nullable=true)
  228. */
  229. private $horasTeleformacion = 0;
  230. public function getHorasAulaVirtual(): ?int
  231. {
  232. return $this->horasAulaVirtual;
  233. }
  234. public function setHorasAulaVirtual(?int $horasAulaVirtual): static
  235. {
  236. $this->horasAulaVirtual = $horasAulaVirtual;
  237. return $this;
  238. }
  239. public function getHorasPresenciales(): ?int
  240. {
  241. return $this->horasPresenciales;
  242. }
  243. public function setHorasPresenciales(?int $horasPresenciales): static
  244. {
  245. $this->horasPresenciales = $horasPresenciales;
  246. return $this;
  247. }
  248. public function getHorasTeleformacion(): ?int
  249. {
  250. return $this->horasTeleformacion;
  251. }
  252. public function setHorasTeleformacion(?int $horasTeleformacion): static
  253. {
  254. $this->horasTeleformacion = $horasTeleformacion;
  255. return $this;
  256. }
  257. public function getHorasTotales(): int
  258. {
  259. return $this->getHorasPresenciales()??0 + $this->getHorasTeleformacion()??0 + $this->getHorasAulaVirtual()??0;
  260. }
  261. }