<?php
namespace App\Core\Entity\Institucion;
use App\Core\Entity\Institucion\Campus;
use App\Core\Repository\Institucion\ProgramaRepository;
use App\Entity\Ciclo;
use App\Entity\TipoCiclo;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ProgramaRepository::class)
*/
class Programa
{
const JSON_FIELDS = ['id', 'nombre', 'campus' => ['id', 'nombre'], 'siguientePrograma' => ['id', 'nombre'], 'programaClon' => ['id', 'nombre'], 'correlativo', 'ciclo' => Ciclo::JSON_FIELDS, 'fecha_inicio', 'fecha_fin', 'estado'];
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=100)
*/
private $nombre;
/**
* @ORM\ManyToOne(targetEntity=Campus::class, inversedBy="programas")
* @ORM\JoinColumn(nullable=false)
*/
private $campus;
/**
* @ORM\ManyToOne(targetEntity=Programa::class)
*/
private $siguientePrograma;
/**
* @ORM\ManyToOne(targetEntity=Programa::class)
*/
private $programaClon;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $correlativo;
/**
* @ORM\OneToMany(targetEntity=Nivel::class, mappedBy="programa")
*/
private $niveles;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $fechaInicio;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $fechaFinal;
/**
* @ORM\ManyToOne(targetEntity=Ciclo::class, inversedBy="programas")
*/
private $ciclo;
/**
* @ORM\ManyToOne(targetEntity=Tipociclo::class)
* @ORM\JoinColumn(nullable=true)
*/
private $tipoCiclo;
public function __construct()
{
$this->niveles = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(string $nombre): self
{
$this->nombre = $nombre;
return $this;
}
public function getCampus(): ?Campus
{
return $this->campus;
}
public function setCampus(?Campus $campus): self
{
$this->campus = $campus;
return $this;
}
public function getSiguientePrograma(): ?self
{
return $this->siguientePrograma;
}
public function setSiguientePrograma(?self $siguientePrograma): self
{
$this->siguientePrograma = $siguientePrograma;
return $this;
}
public function getProgramaClon(): ?self
{
return $this->programaClon;
}
public function setProgramaClon(?self $programaClon): self
{
$this->programaClon = $programaClon;
return $this;
}
public function getCorrelativo(): ?string
{
return $this->correlativo;
}
public function setCorrelativo(?string $correlativo): self
{
$this->correlativo = $correlativo;
return $this;
}
/**
* @return Collection|Nivel[]
*/
public function getNiveles(): Collection
{
return $this->niveles;
}
public function addNivele(Nivel $nivele): self
{
if (!$this->niveles->contains($nivele)) {
$this->niveles[] = $nivele;
$nivele->setPrograma($this);
}
return $this;
}
public function removeNivele(Nivel $nivele): self
{
if ($this->niveles->removeElement($nivele)) {
// set the owning side to null (unless already changed)
if ($nivele->getPrograma() === $this) {
$nivele->setPrograma(null);
}
}
return $this;
}
public function getFechaInicio(): ?\DateTimeInterface
{
return $this->fechaInicio;
}
public function setFechaInicio(?\DateTimeInterface $fechaInicio): self
{
$this->fechaInicio = $fechaInicio;
return $this;
}
public function getFechaFinal(): ?\DateTimeInterface
{
return $this->fechaFinal;
}
public function setFechaFinal(?\DateTimeInterface $fechaFinal): self
{
$this->fechaFinal = $fechaFinal;
return $this;
}
// Getter para Ciclo
public function getCiclo(): ?Ciclo
{
return $this->ciclo;
}
// Setter para Ciclo
public function setCiclo(?Ciclo $ciclo): self
{
$this->ciclo = $ciclo;
return $this;
}
public function getTipoCiclo(): ?TipoCiclo
{
return $this->tipoCiclo;
}
public function setTipoCiclo(?TipoCiclo $tipoCiclo): self
{
$this->tipoCiclo = $tipoCiclo;
return $this;
}
}