<?php
namespace App\Asistencia\Entity;
use App\Core\Entity\Curso;
use App\Asistencia\Entity\Comentario;
use App\Asistencia\Entity\Asistencia;
use App\Asistencia\Entity\RegistroEvaluacion;
use App\Core\Entity\PuntuacionClase;
use App\Entity\ClaseArchivo;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass="App\Asistencia\Repository\ClaseRepository")
*/
class Clase
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
* @Groups({"main", "asistencia"})
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Core\Entity\Curso", inversedBy="clases")
* @ORM\JoinColumn(nullable=false)
*/
private $curso;
/**
* @ORM\Column(type="date")
* @Groups("asistencia")
*/
private $fecha;
/**
* @ORM\Column(type="time")
*/
private $horaInicio;
/**
* @ORM\Column(type="time")
*/
private $horaFin;
/**
* @ORM\Column(type="integer")
* 0 = programado, 1 = cancelada, 2 = terminada
* @Groups("main")
*/
private $estado;
/**
* @ORM\Column(type="string", length=255)
*/
private $titulo;
/**
* @ORM\OneToMany(targetEntity="App\Asistencia\Entity\Objetivo", mappedBy="clase", orphanRemoval=true)
*/
private $objetivos;
/**
* @ORM\OneToMany(targetEntity="App\Asistencia\Entity\Comentario", mappedBy="clase", orphanRemoval=true)
*/
private $comentarios;
/**
* @ORM\OneToMany(targetEntity="App\Asistencia\Entity\Asistencia", mappedBy="clase", orphanRemoval=true)
*/
private $asistencias;
/**
* @ORM\OneToMany(targetEntity="App\Asistencia\Entity\RegistroEvaluacion", mappedBy="clase", orphanRemoval=true)
*/
private $registroEvaluaciones;
/**
* @ORM\OneToMany(targetEntity=PuntuacionClase::class, mappedBy="clase", orphanRemoval=true)
*/
private $puntuaciones;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $puntuacionPromedio;
/**
* @ORM\OneToMany(targetEntity=ClaseArchivo::class, mappedBy="clase")
*/
private $claseArchivos;
public function __construct()
{
$this->objetivos = new ArrayCollection();
$this->comentarios = new ArrayCollection();
$this->asistencias = new ArrayCollection();
$this->registroEvaluaciones = new ArrayCollection();
$this->puntuaciones = new ArrayCollection();
$this->claseArchivos = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCurso(): ?Curso
{
return $this->curso;
}
public function setCurso(?Curso $curso): self
{
$this->curso = $curso;
return $this;
}
public function getFecha(): ?\DateTimeInterface
{
return $this->fecha;
}
public function setFecha(\DateTimeInterface $fecha): self
{
$this->fecha = $fecha;
return $this;
}
public function getHoraInicio(): ?\DateTimeInterface
{
return $this->horaInicio;
}
public function setHoraInicio(\DateTimeInterface $horaInicio): self
{
$this->horaInicio = $horaInicio;
return $this;
}
public function getHoraFin(): ?\DateTimeInterface
{
return $this->horaFin;
}
public function setHoraFin(\DateTimeInterface $horaFin): self
{
$this->horaFin = $horaFin;
return $this;
}
public function getEstado(): ?int
{
return $this->estado;
}
public function setEstado(int $estado): self
{
$this->estado = $estado;
return $this;
}
public function getTitulo(): ?string
{
return $this->titulo;
}
public function setTitulo(string $titulo): self
{
$this->titulo = $titulo;
return $this;
}
/**
* @return Collection|Objetivo[]
*/
public function getObjetivos(): Collection
{
return $this->objetivos;
}
public function addObjetivo(Objetivo $objetivo): self
{
if (!$this->objetivos->contains($objetivo)) {
$this->objetivos[] = $objetivo;
$objetivo->setClase($this);
}
return $this;
}
public function removeObjetivo(Objetivo $objetivo): self
{
if ($this->objetivos->contains($objetivo)) {
$this->objetivos->removeElement($objetivo);
// set the owning side to null (unless already changed)
if ($objetivo->getClase() === $this) {
$objetivo->setClase(null);
}
}
return $this;
}
/**
* @return Collection|Comentario[]
*/
public function getComentarios(): Collection
{
return $this->comentarios;
}
public function addComentario(Comentario $comentario): self
{
if (!$this->comentarios->contains($comentario)) {
$this->comentarios[] = $comentario;
$comentario->setClase($this);
}
return $this;
}
public function removeComentario(Comentario $comentario): self
{
if ($this->comentarios->contains($comentario)) {
$this->comentarios->removeElement($comentario);
// set the owning side to null (unless already changed)
if ($comentario->getClase() === $this) {
$comentario->setClase(null);
}
}
return $this;
}
/**
* @return Collection|Asistencia[]
*/
public function getAsistencias(): Collection
{
return $this->asistencias;
}
public function addAsistencia(Asistencia $asistencia): self
{
if (!$this->asistencias->contains($asistencia)) {
$this->asistencias[] = $asistencia;
$asistencia->setClase($this);
}
return $this;
}
public function removeAsistencia(Asistencia $asistencia): self
{
if ($this->asistencias->contains($asistencia)) {
$this->asistencias->removeElement($asistencia);
// set the owning side to null (unless already changed)
if ($asistencia->getClase() === $this) {
$asistencia->setClase(null);
}
}
return $this;
}
/**
* @return Collection|RegistroEvaluacion[]
*/
public function getRegistroEvaluaciones(): Collection
{
return $this->registroEvaluaciones;
}
public function addRegistroEvaluacione(RegistroEvaluacion $registroEvaluacione): self
{
if (!$this->registroEvaluaciones->contains($registroEvaluacione)) {
$this->registroEvaluaciones[] = $registroEvaluacione;
$registroEvaluacione->setClase($this);
}
return $this;
}
public function removeRegistroEvaluacione(RegistroEvaluacion $registroEvaluacione): self
{
if ($this->registroEvaluaciones->contains($registroEvaluacione)) {
$this->registroEvaluaciones->removeElement($registroEvaluacione);
// set the owning side to null (unless already changed)
if ($registroEvaluacione->getClase() === $this) {
$registroEvaluacione->setClase(null);
}
}
return $this;
}
/**
* @return Collection|PuntuacionClase[]
*/
public function getPuntuaciones(): Collection
{
return $this->puntuaciones;
}
public function addPuntuacione(PuntuacionClase $puntuacion): self
{
if (!$this->puntuaciones->contains($puntuacion)) {
$this->puntuaciones[] = $puntuacion;
$puntuacion->setClase($this);
}
return $this;
}
public function removePuntuacione(PuntuacionClase $puntuacion): self
{
if ($this->puntuaciones->contains($puntuacion)) {
$this->puntuaciones->removeElement($puntuacion);
// set the owning side to null (unless already changed)
if ($puntuacion->getClase() === $this) {
$puntuacion->setClase(null);
}
}
return $this;
}
/**
* @return float
*/
public function getPuntuacionPromedio(): ?float
{
return $this->puntuacionPromedio;
}
/**
* @param float $puntuacionPromedio
*/
public function setPuntuacionPromedio(float $puntuacionPromedio): void
{
$this->puntuacionPromedio = $puntuacionPromedio;
}
/**
* @return Collection<int, ClaseArchivo>
*/
public function getClaseArchivos(): Collection
{
return $this->claseArchivos;
}
public function addClaseArchivo(ClaseArchivo $claseArchivo): self
{
if (!$this->claseArchivos->contains($claseArchivo)) {
$this->claseArchivos[] = $claseArchivo;
$claseArchivo->setClase($this);
}
return $this;
}
public function removeClaseArchivo(ClaseArchivo $claseArchivo): self
{
if ($this->claseArchivos->removeElement($claseArchivo)) {
// set the owning side to null (unless already changed)
if ($claseArchivo->getClase() === $this) {
$claseArchivo->setClase(null);
}
}
return $this;
}
}