src/Entity/AccionFormativa.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AccionFormativaRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. #[ORM\Entity(repositoryClass: AccionFormativaRepository::class)]
  9. class AccionFormativa
  10. {
  11. #[ORM\Id]
  12. #[ORM\GeneratedValue]
  13. #[ORM\Column(type: 'integer')]
  14. private $id;
  15. #[ORM\ManyToOne(targetEntity: NivelFormativo::class, inversedBy: 'accionesFormativas')]
  16. private ?NivelFormativo $nivelFormativo = null;
  17. #[Assert\NotBlank]
  18. #[Assert\Length(max: 255)]
  19. #[ORM\Column(type: 'string', length: 255)]
  20. private ?string $nombre = null;
  21. #[Assert\Length(max: 255)]
  22. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  23. private ?string $codigoMinisterio = null;
  24. #[Assert\Range(min: 2025, max: 2035)]
  25. #[ORM\Column(type: 'integer', nullable: true)]
  26. private ?int $anualidad = null;
  27. #[ORM\Column(type: 'boolean')]
  28. private bool $certificado = false;
  29. #[Assert\Positive]
  30. #[ORM\Column(type: 'integer', nullable: true)]
  31. private ?int $aforoTitulares = null;
  32. #[Assert\PositiveOrZero]
  33. #[ORM\Column(type: 'integer', nullable: true)]
  34. private ?int $aforoSuplentes = null;
  35. // Se guardará el valor en segundos por si se usa para cálculos.
  36. #[Assert\Positive]
  37. #[ORM\Column(type: 'integer', nullable: true)]
  38. private ?int $diasDuracion = null;
  39. // Se guardará el valor en segundos por si se usa para cálculos.
  40. #[Assert\Positive]
  41. #[ORM\Column(type: 'integer', nullable: true)]
  42. private ?int $horasDuracion = null;
  43. // Se guardará el valor en segundos por si se usa para cálculos.
  44. #[Assert\Positive]
  45. #[ORM\Column(type: 'integer', nullable: true)]
  46. private ?int $horasFormacionEspecifica = null;
  47. // Se guardará el valor en segundos por si se usa para cálculos.
  48. #[Assert\Positive]
  49. #[ORM\Column(type: 'integer', nullable: true)]
  50. private ?int $horasPracticaProfesional = null;
  51. // Se guardará el valor en segundos por si se usa para cálculos.
  52. #[Assert\Positive]
  53. #[ORM\Column(type: 'integer', nullable: true)]
  54. private ?int $horasFormacionTransversal = null;
  55. // Se guardará el valor en segundos por si se usa para cálculos.
  56. #[Assert\Positive]
  57. #[ORM\Column(type: 'integer', nullable: true)]
  58. private ?int $horasFormacionComplementaria = null;
  59. // Se guardará el valor en segundos por si se usa para cálculos.
  60. #[Assert\Positive]
  61. #[ORM\Column(type: 'integer', nullable: true)]
  62. private ?int $horasTutoriaEspecifica = null;
  63. // Se guardará el valor en segundos por si se usa para cálculos.
  64. #[Assert\Positive]
  65. #[ORM\Column(type: 'integer', nullable: true)]
  66. private ?int $horasTutoriaPractica = null;
  67. #[Assert\Positive]
  68. #[ORM\Column(type: 'float', nullable: true)]
  69. private ?float $ayudaMaxima = null;
  70. #[ORM\Column(type: 'text', nullable: true)]
  71. private ?string $descripcionCurso = null;
  72. #[ORM\Column(type: 'text', nullable: true)]
  73. private ?string $descripcionNivel = null;
  74. #[ORM\Column(type: 'boolean')]
  75. private bool $borrado = false;
  76. #[ORM\OneToMany(targetEntity: Curso::class, mappedBy: 'accionFormativa')]
  77. private Collection $cursos;
  78. #[ORM\Column(type: 'boolean')]
  79. private ?bool $requiereCarnetConducir = null;
  80. #[ORM\Column(length: 7, nullable: true)]
  81. private ?string $colorGantt = null;
  82. #[ORM\Column(length: 255, nullable: true)]
  83. private ?string $imagen = null;
  84. public function __construct()
  85. {
  86. $this->cursos = new ArrayCollection();
  87. }
  88. public function getId(): ?int
  89. {
  90. return $this->id;
  91. }
  92. public function getNivelFormativo(): ?NivelFormativo
  93. {
  94. return $this->nivelFormativo;
  95. }
  96. public function setNivelFormativo(?NivelFormativo $nivelFormativo): self
  97. {
  98. $this->nivelFormativo = $nivelFormativo;
  99. return $this;
  100. }
  101. public function getNombre(): ?string
  102. {
  103. return $this->nombre;
  104. }
  105. public function setNombre(?string $nombre): self
  106. {
  107. $this->nombre = $nombre;
  108. return $this;
  109. }
  110. public function getCodigoMinisterio(): ?string
  111. {
  112. return $this->codigoMinisterio;
  113. }
  114. public function setCodigoMinisterio(?string $codigoMinisterio): self
  115. {
  116. $this->codigoMinisterio = $codigoMinisterio;
  117. return $this;
  118. }
  119. public function getAnualidad(): ?int
  120. {
  121. return $this->anualidad;
  122. }
  123. public function setAnualidad(?int $anualidad): self
  124. {
  125. $this->anualidad = $anualidad;
  126. return $this;
  127. }
  128. public function isCertificado(): ?bool
  129. {
  130. return $this->certificado;
  131. }
  132. public function setCertificado(bool $certificado): self
  133. {
  134. $this->certificado = $certificado;
  135. return $this;
  136. }
  137. public function getAforoTitulares(): ?int
  138. {
  139. return $this->aforoTitulares;
  140. }
  141. public function setAforoTitulares(?int $aforoTitulares): self
  142. {
  143. $this->aforoTitulares = $aforoTitulares;
  144. return $this;
  145. }
  146. public function getAforoSuplentes(): ?int
  147. {
  148. return $this->aforoSuplentes;
  149. }
  150. public function setAforoSuplentes(?int $aforoSuplentes): self
  151. {
  152. $this->aforoSuplentes = $aforoSuplentes;
  153. return $this;
  154. }
  155. public function getDiasDuracion(): ?int
  156. {
  157. return $this->diasDuracion;
  158. }
  159. public function setDiasDuracion(?int $diasDuracion): self
  160. {
  161. $this->diasDuracion = $diasDuracion;
  162. return $this;
  163. }
  164. public function getHorasDuracion(): ?int
  165. {
  166. return $this->horasDuracion;
  167. }
  168. public function setHorasDuracion(?int $horasDuracion): self
  169. {
  170. $this->horasDuracion = $horasDuracion;
  171. return $this;
  172. }
  173. public function getHorasFormacionEspecifica(): ?int
  174. {
  175. return $this->horasFormacionEspecifica;
  176. }
  177. public function setHorasFormacionEspecifica(?int $horasFormacionEspecifica): self
  178. {
  179. $this->horasFormacionEspecifica = $horasFormacionEspecifica;
  180. return $this;
  181. }
  182. public function getHorasPracticaProfesional(): ?int
  183. {
  184. return $this->horasPracticaProfesional;
  185. }
  186. public function setHorasPracticaProfesional(?int $horasPracticaProfesional): self
  187. {
  188. $this->horasPracticaProfesional = $horasPracticaProfesional;
  189. return $this;
  190. }
  191. public function getHorasFormacionTransversal(): ?int
  192. {
  193. return $this->horasFormacionTransversal;
  194. }
  195. public function setHorasFormacionTransversal(?int $horasFormacionTransversal): self
  196. {
  197. $this->horasFormacionTransversal = $horasFormacionTransversal;
  198. return $this;
  199. }
  200. public function getHorasFormacionComplementaria(): ?int
  201. {
  202. return $this->horasFormacionComplementaria;
  203. }
  204. public function setHorasFormacionComplementaria(?int $horasFormacionComplementaria): self
  205. {
  206. $this->horasFormacionComplementaria = $horasFormacionComplementaria;
  207. return $this;
  208. }
  209. public function getHorasTutoriaEspecifica(): ?int
  210. {
  211. return $this->horasTutoriaEspecifica;
  212. }
  213. public function setHorasTutoriaEspecifica(?int $horasTutoriaEspecifica): self
  214. {
  215. $this->horasTutoriaEspecifica = $horasTutoriaEspecifica;
  216. return $this;
  217. }
  218. public function getHorasTutoriaPractica(): ?int
  219. {
  220. return $this->horasTutoriaPractica;
  221. }
  222. public function setHorasTutoriaPractica(?int $horasTutoriaPractica): self
  223. {
  224. $this->horasTutoriaPractica = $horasTutoriaPractica;
  225. return $this;
  226. }
  227. public function getAyudaMaxima(): ?float
  228. {
  229. return $this->ayudaMaxima;
  230. }
  231. public function setAyudaMaxima(?float $ayudaMaxima): self
  232. {
  233. $this->ayudaMaxima = $ayudaMaxima;
  234. return $this;
  235. }
  236. public function getDescripcionCurso(): ?string
  237. {
  238. return $this->descripcionCurso;
  239. }
  240. public function setDescripcionCurso(?string $descripcionCurso): self
  241. {
  242. $this->descripcionCurso = $descripcionCurso;
  243. return $this;
  244. }
  245. public function getDescripcionNivel(): ?string
  246. {
  247. return $this->descripcionNivel;
  248. }
  249. public function setDescripcionNivel(?string $descripcionNivel): self
  250. {
  251. $this->descripcionNivel = $descripcionNivel;
  252. return $this;
  253. }
  254. public function isBorrado(): ?bool
  255. {
  256. return $this->borrado;
  257. }
  258. public function setBorrado(bool $borrado): self
  259. {
  260. $this->borrado = $borrado;
  261. return $this;
  262. }
  263. /**
  264. * @return Collection<int, Curso>
  265. */
  266. public function getCursos(): Collection
  267. {
  268. return $this->cursos;
  269. }
  270. public function addCurso(Curso $curso): self
  271. {
  272. if (!$this->cursos->contains($curso)) {
  273. $this->cursos[] = $curso;
  274. $curso->setAccionFormativa($this);
  275. }
  276. return $this;
  277. }
  278. public function removeCurso(Curso $curso): self
  279. {
  280. // set the owning side to null (unless already changed)
  281. if ($this->cursos->removeElement($curso) && $curso->getAccionFormativa() === $this) {
  282. $curso->setAccionFormativa(null);
  283. }
  284. return $this;
  285. }
  286. public function isRequiereCarnetConducir(): ?bool
  287. {
  288. return $this->requiereCarnetConducir;
  289. }
  290. public function setRequiereCarnetConducir(bool $requiereCarnetConducir): self
  291. {
  292. $this->requiereCarnetConducir = $requiereCarnetConducir;
  293. return $this;
  294. }
  295. public function getColorGantt(): ?string
  296. {
  297. return $this->colorGantt;
  298. }
  299. public function setColorGantt(?string $colorGantt): static
  300. {
  301. $this->colorGantt = $colorGantt;
  302. return $this;
  303. }
  304. public function getImagen(): ?string
  305. {
  306. return $this->imagen;
  307. }
  308. public function setImagen(?string $imagen): static
  309. {
  310. $this->imagen = $imagen;
  311. return $this;
  312. }
  313. }