src/Core/Entity/Institucion/Programa.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Core\Entity\Institucion;
  3. use App\Core\Entity\Institucion\Campus;
  4. use App\Core\Repository\Institucion\ProgramaRepository;
  5. use App\Entity\Ciclo;
  6. use App\Entity\TipoCiclo;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. /**
  11. * @ORM\Entity(repositoryClass=ProgramaRepository::class)
  12. */
  13. class Programa
  14. {
  15. const JSON_FIELDS = ['id', 'nombre', 'campus' => ['id', 'nombre'], 'siguientePrograma' => ['id', 'nombre'], 'programaClon' => ['id', 'nombre'], 'correlativo', 'ciclo' => Ciclo::JSON_FIELDS, 'fecha_inicio', 'fecha_fin', 'estado'];
  16. /**
  17. * @ORM\Id
  18. * @ORM\GeneratedValue
  19. * @ORM\Column(type="integer")
  20. */
  21. private $id;
  22. /**
  23. * @ORM\Column(type="string", length=100)
  24. */
  25. private $nombre;
  26. /**
  27. * @ORM\ManyToOne(targetEntity=Campus::class, inversedBy="programas")
  28. * @ORM\JoinColumn(nullable=false)
  29. */
  30. private $campus;
  31. /**
  32. * @ORM\ManyToOne(targetEntity=Programa::class)
  33. */
  34. private $siguientePrograma;
  35. /**
  36. * @ORM\ManyToOne(targetEntity=Programa::class)
  37. */
  38. private $programaClon;
  39. /**
  40. * @ORM\Column(type="string", length=50, nullable=true)
  41. */
  42. private $correlativo;
  43. /**
  44. * @ORM\OneToMany(targetEntity=Nivel::class, mappedBy="programa")
  45. */
  46. private $niveles;
  47. /**
  48. * @ORM\Column(type="date", nullable=true)
  49. */
  50. private $fechaInicio;
  51. /**
  52. * @ORM\Column(type="date", nullable=true)
  53. */
  54. private $fechaFinal;
  55. /**
  56. * @ORM\ManyToOne(targetEntity=Ciclo::class, inversedBy="programas")
  57. */
  58. private $ciclo;
  59. /**
  60. * @ORM\ManyToOne(targetEntity=Tipociclo::class)
  61. * @ORM\JoinColumn(nullable=true)
  62. */
  63. private $tipoCiclo;
  64. public function __construct()
  65. {
  66. $this->niveles = new ArrayCollection();
  67. }
  68. public function getId(): ?int
  69. {
  70. return $this->id;
  71. }
  72. public function getNombre(): ?string
  73. {
  74. return $this->nombre;
  75. }
  76. public function setNombre(string $nombre): self
  77. {
  78. $this->nombre = $nombre;
  79. return $this;
  80. }
  81. public function getCampus(): ?Campus
  82. {
  83. return $this->campus;
  84. }
  85. public function setCampus(?Campus $campus): self
  86. {
  87. $this->campus = $campus;
  88. return $this;
  89. }
  90. public function getSiguientePrograma(): ?self
  91. {
  92. return $this->siguientePrograma;
  93. }
  94. public function setSiguientePrograma(?self $siguientePrograma): self
  95. {
  96. $this->siguientePrograma = $siguientePrograma;
  97. return $this;
  98. }
  99. public function getProgramaClon(): ?self
  100. {
  101. return $this->programaClon;
  102. }
  103. public function setProgramaClon(?self $programaClon): self
  104. {
  105. $this->programaClon = $programaClon;
  106. return $this;
  107. }
  108. public function getCorrelativo(): ?string
  109. {
  110. return $this->correlativo;
  111. }
  112. public function setCorrelativo(?string $correlativo): self
  113. {
  114. $this->correlativo = $correlativo;
  115. return $this;
  116. }
  117. /**
  118. * @return Collection|Nivel[]
  119. */
  120. public function getNiveles(): Collection
  121. {
  122. return $this->niveles;
  123. }
  124. public function addNivele(Nivel $nivele): self
  125. {
  126. if (!$this->niveles->contains($nivele)) {
  127. $this->niveles[] = $nivele;
  128. $nivele->setPrograma($this);
  129. }
  130. return $this;
  131. }
  132. public function removeNivele(Nivel $nivele): self
  133. {
  134. if ($this->niveles->removeElement($nivele)) {
  135. // set the owning side to null (unless already changed)
  136. if ($nivele->getPrograma() === $this) {
  137. $nivele->setPrograma(null);
  138. }
  139. }
  140. return $this;
  141. }
  142. public function getFechaInicio(): ?\DateTimeInterface
  143. {
  144. return $this->fechaInicio;
  145. }
  146. public function setFechaInicio(?\DateTimeInterface $fechaInicio): self
  147. {
  148. $this->fechaInicio = $fechaInicio;
  149. return $this;
  150. }
  151. public function getFechaFinal(): ?\DateTimeInterface
  152. {
  153. return $this->fechaFinal;
  154. }
  155. public function setFechaFinal(?\DateTimeInterface $fechaFinal): self
  156. {
  157. $this->fechaFinal = $fechaFinal;
  158. return $this;
  159. }
  160. // Getter para Ciclo
  161. public function getCiclo(): ?Ciclo
  162. {
  163. return $this->ciclo;
  164. }
  165. // Setter para Ciclo
  166. public function setCiclo(?Ciclo $ciclo): self
  167. {
  168. $this->ciclo = $ciclo;
  169. return $this;
  170. }
  171. public function getTipoCiclo(): ?TipoCiclo
  172. {
  173. return $this->tipoCiclo;
  174. }
  175. public function setTipoCiclo(?TipoCiclo $tipoCiclo): self
  176. {
  177. $this->tipoCiclo = $tipoCiclo;
  178. return $this;
  179. }
  180. }