<?php
namespace App\Core\Entity\Institucion;
use App\Core\Entity\EstudianteCurso;
use App\Core\Repository\Institucion\SeccionRepository;
use App\Core\Entity\MaestroCurso;
use App\Core\Entity\Curso;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=SeccionRepository::class)
*/
class Seccion
{
const JSON_FIELDS = ['id', 'nombre', 'correlativo', 'nivel' => ['id', 'nombre'], 'seccionClon' => ['id', 'nombre']];
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=100)
*/
private $nombre;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $correlativo;
/**
* @ORM\ManyToOne(targetEntity=Nivel::class, inversedBy="secciones")
*/
private $nivel;
/**
* @ORM\ManyToOne(targetEntity=Seccion::class)
*/
private $seccionClon;
/**
* @ORM\OneToMany(targetEntity="App\Core\Entity\EstudianteCurso", mappedBy="seccion")
*/
private $estudiantesCurso;
/**
* @ORM\OneToMany(targetEntity=MaestroCurso::class, mappedBy="seccion")
*/
private $maestroCursos;
/**
* @ORM\OneToMany(targetEntity="App\Core\Entity\Curso", mappedBy="seccion")
*/
private $cursos;
public function __construct()
{
$this->estudiantesCurso = new ArrayCollection();
$this->maestroCursos = new ArrayCollection();
$this->cursos = 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 getCorrelativo(): ?string
{
return $this->correlativo;
}
public function setCorrelativo(?string $correlativo): self
{
$this->correlativo = $correlativo;
return $this;
}
public function getNivel(): ?Nivel
{
return $this->nivel;
}
public function setNivel(?Nivel $nivel): self
{
$this->nivel = $nivel;
return $this;
}
public function getSeccionClon(): ?self
{
return $this->seccionClon;
}
public function setSeccionClon(?self $seccionClon): self
{
$this->seccionClon = $seccionClon;
return $this;
}
/**
* @return Collection|EstudianteCurso[]
*/
public function getEstudiantesCurso(): Collection
{
return $this->estudiantesCurso;
}
public function addEstudianteCurso(EstudianteCurso $estudianteCurso): self
{
if (!$this->estudiantesCurso->contains($estudianteCurso)) {
$this->estudiantesCurso[] = $estudianteCurso;
$estudianteCurso->setSeccion($this);
}
return $this;
}
public function removeEstudianteCurso(EstudianteCurso $estudianteCurso): self
{
if ($this->estudiantesCurso->contains($estudianteCurso)) {
$this->estudiantesCurso->removeElement($estudianteCurso);
// set the owning side to null (unless already changed)
if ($estudianteCurso->getSeccion() === $this) {
$estudianteCurso->setSeccion(null);
}
}
return $this;
}
/**
* @return Collection<int, MaestroCurso>
*/
public function getMaestroCursos(): Collection
{
return $this->maestroCursos;
}
public function addMaestroCurso(MaestroCurso $maestroCurso): self
{
if (!$this->maestroCursos->contains($maestroCurso)) {
$this->maestroCursos[] = $maestroCurso;
$maestroCurso->setSeccion($this);
}
return $this;
}
public function removeMaestroCurso(MaestroCurso $maestroCurso): self
{
if ($this->maestroCursos->removeElement($maestroCurso)) {
// set the owning side to null (unless already changed)
if ($maestroCurso->getSeccion() === $this) {
$maestroCurso->setSeccion(null);
}
}
return $this;
}
/**
* @return Collection|Curso[]
*/
public function getCursos(): Collection
{
return $this->cursos;
}
public function addCurso(Curso $curso): self
{
if (!$this->cursos->contains($curso)) {
$this->cursos[] = $curso;
$curso->setSeccion($this);
}
return $this;
}
public function removeCurso(Curso $curso): self
{
if ($this->cursos->removeElement($curso)) {
// set the owning side to null (unless already changed)
if ($curso->getSeccion() === $this) {
$curso->setSeccion(null);
}
}
return $this;
}
}