src/Entity/NivelFormativo.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NivelFormativoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClass: NivelFormativoRepository::class)]
  8. class NivelFormativo
  9. {
  10. #[ORM\Id]
  11. #[ORM\GeneratedValue]
  12. #[ORM\Column(type: 'integer')]
  13. private $id;
  14. #[ORM\Column(type: 'string', length: 255)]
  15. private ?string $nombre = null;
  16. #[ORM\Column(type: 'boolean')]
  17. private bool $visible = true;
  18. #[ORM\Column(type: 'boolean')]
  19. private bool $borrado = false;
  20. #[ORM\OneToMany(targetEntity: AccionFormativa::class, mappedBy: 'nivelFormativo')]
  21. private Collection $accionesFormativas;
  22. #[ORM\Column(type: 'text', nullable: true)]
  23. private ?string $descripcionNivelPlantilla = null;
  24. public function __construct()
  25. {
  26. $this->accionesFormativas = new ArrayCollection();
  27. }
  28. public function getId(): ?int
  29. {
  30. return $this->id;
  31. }
  32. public function getNombre(): ?string
  33. {
  34. return $this->nombre;
  35. }
  36. public function setNombre(?string $nombre): self
  37. {
  38. $this->nombre = $nombre;
  39. return $this;
  40. }
  41. public function isVisible(): ?bool
  42. {
  43. return $this->visible;
  44. }
  45. public function setVisible(bool $visible): self
  46. {
  47. $this->visible = $visible;
  48. return $this;
  49. }
  50. public function isBorrado(): ?bool
  51. {
  52. return $this->borrado;
  53. }
  54. public function setBorrado(bool $borrado): self
  55. {
  56. $this->borrado = $borrado;
  57. return $this;
  58. }
  59. /**
  60. * @return Collection<int, AccionFormativa>
  61. */
  62. public function getAccionesFormativas(): Collection
  63. {
  64. return $this->accionesFormativas;
  65. }
  66. public function addAccionesFormativa(AccionFormativa $accionesFormativa): self
  67. {
  68. if (!$this->accionesFormativas->contains($accionesFormativa)) {
  69. $this->accionesFormativas[] = $accionesFormativa;
  70. $accionesFormativa->setNivelFormativo($this);
  71. }
  72. return $this;
  73. }
  74. public function removeAccionesFormativa(AccionFormativa $accionesFormativa): self
  75. {
  76. // set the owning side to null (unless already changed)
  77. if ($this->accionesFormativas->removeElement($accionesFormativa) && $accionesFormativa->getNivelFormativo() === $this) {
  78. $accionesFormativa->setNivelFormativo(null);
  79. }
  80. return $this;
  81. }
  82. public function getDescripcionNivelPlantilla(): ?string
  83. {
  84. return $this->descripcionNivelPlantilla;
  85. }
  86. public function setDescripcionNivelPlantilla(?string $descripcionNivelPlantilla): self
  87. {
  88. $this->descripcionNivelPlantilla = $descripcionNivelPlantilla;
  89. return $this;
  90. }
  91. }