src/Entity/TipoFormacionCurso.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TipoFormacionCursoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClass: TipoFormacionCursoRepository::class)]
  8. class TipoFormacionCurso
  9. {
  10. #[ORM\Id]
  11. #[ORM\GeneratedValue]
  12. #[ORM\Column]
  13. private ?int $id = null;
  14. #[ORM\Column(length: 255)]
  15. private ?string $nombre;
  16. #[ORM\Column(length: 7)]
  17. private ?string $colorHexFondo;
  18. #[ORM\Column(length: 7)]
  19. private ?string $colorHexTexto;
  20. #[ORM\Column]
  21. private ?bool $visible = true;
  22. #[ORM\Column]
  23. private ?bool $borrado = false;
  24. #[ORM\OneToMany(mappedBy: 'tipoFormacion', targetEntity: CalendarioCurso::class)]
  25. private Collection $calendario;
  26. public function __construct()
  27. {
  28. $this->calendario = new ArrayCollection();
  29. }
  30. public function getId(): ?int
  31. {
  32. return $this->id;
  33. }
  34. public function getNombre(): ?string
  35. {
  36. return $this->nombre;
  37. }
  38. public function setNombre(string $nombre): static
  39. {
  40. $this->nombre = $nombre;
  41. return $this;
  42. }
  43. public function getColorHexFondo(): ?string
  44. {
  45. return $this->colorHexFondo;
  46. }
  47. public function setColorHexFondo(string $colorHexFondo): static
  48. {
  49. $this->colorHexFondo = $colorHexFondo;
  50. return $this;
  51. }
  52. public function getColorHexTexto(): ?string
  53. {
  54. return $this->colorHexTexto;
  55. }
  56. public function setColorHexTexto(string $colorHexTexto): static
  57. {
  58. $this->colorHexTexto = $colorHexTexto;
  59. return $this;
  60. }
  61. public function isVisible(): ?bool
  62. {
  63. return $this->visible;
  64. }
  65. public function setVisible(bool $visible): static
  66. {
  67. $this->visible = $visible;
  68. return $this;
  69. }
  70. public function isBorrado(): ?bool
  71. {
  72. return $this->borrado;
  73. }
  74. public function setBorrado(bool $borrado): static
  75. {
  76. $this->borrado = $borrado;
  77. return $this;
  78. }
  79. /**
  80. * @return Collection<int, CalendarioCurso>
  81. */
  82. public function getCalendario(): Collection
  83. {
  84. return $this->calendario;
  85. }
  86. public function addCalendario(CalendarioCurso $calendario): static
  87. {
  88. if (!$this->calendario->contains($calendario)) {
  89. $this->calendario->add($calendario);
  90. $calendario->setTipoFormacion($this);
  91. }
  92. return $this;
  93. }
  94. public function removeCalendario(CalendarioCurso $calendario): static
  95. {
  96. if ($this->calendario->removeElement($calendario)) {
  97. // set the owning side to null (unless already changed)
  98. if ($calendario->getTipoFormacion() === $this) {
  99. $calendario->setTipoFormacion(null);
  100. }
  101. }
  102. return $this;
  103. }
  104. }