<?php
namespace App\Asistencia\Entity;
use App\Core\Entity\Color;
use App\Core\Entity\Curso;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Asistencia\Repository\EvaluacionRepository")
*/
class Evaluacion
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Core\Entity\Curso", inversedBy="evaluaciones")
* @ORM\JoinColumn(nullable=false)
*/
private $curso;
/**
* @ORM\Column(type="string", length=100)
*/
private $nombre;
/**
* @ORM\Column(type="integer")
* 1 = checklist
* 2 = escala de evaluacion
*/
private $tipo;
/**
* @ORM\OneToMany(targetEntity="App\Asistencia\Entity\EscalaEvaluacion", mappedBy="evaluacion", cascade={"remove"})
*/
private $escalaEvaluaciones;
/**
* @ORM\OneToMany(targetEntity="App\Asistencia\Entity\Caracteristica", mappedBy="evaluacion", orphanRemoval=true, cascade={"remove"})
*/
private $caracteristicas;
/**
* @ORM\OneToMany(targetEntity="App\Asistencia\Entity\RegistroEvaluacion", mappedBy="evaluacion", orphanRemoval=true, cascade={"remove"})
*/
private $registroEvaluaciones;
/**
* @ORM\ManyToOne(targetEntity="App\Core\Entity\Color")
* @ORM\JoinColumn(nullable=false)
*/
private $color;
/**
* @ORM\Column(type="boolean")
*/
private $publico;
public function __construct()
{
$this->escalaEvaluaciones = new ArrayCollection();
$this->caracteristicas = new ArrayCollection();
$this->registroEvaluaciones = 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 getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(string $nombre): self
{
$this->nombre = $nombre;
return $this;
}
public function getTipo(): ?int
{
return $this->tipo;
}
public function setTipo(int $tipo): self
{
$this->tipo = $tipo;
return $this;
}
/**
* @return Collection|EscalaEvaluacion[]
*/
public function getEscalaEvaluaciones(): Collection
{
return $this->escalaEvaluaciones;
}
public function addEscalaEvaluacione(EscalaEvaluacion $escalaEvaluacione): self
{
if (!$this->escalaEvaluaciones->contains($escalaEvaluacione)) {
$this->escalaEvaluaciones[] = $escalaEvaluacione;
$escalaEvaluacione->setEvaluacion($this);
}
return $this;
}
public function removeEscalaEvaluacione(EscalaEvaluacion $escalaEvaluacione): self
{
if ($this->escalaEvaluaciones->contains($escalaEvaluacione)) {
$this->escalaEvaluaciones->removeElement($escalaEvaluacione);
// set the owning side to null (unless already changed)
if ($escalaEvaluacione->getEvaluacion() === $this) {
$escalaEvaluacione->setEvaluacion(null);
}
}
return $this;
}
/**
* @return Collection|Caracteristica[]
*/
public function getCaracteristicas(): Collection
{
return $this->caracteristicas;
}
public function addCaracteristica(Caracteristica $caracteristica): self
{
if (!$this->caracteristicas->contains($caracteristica)) {
$this->caracteristicas[] = $caracteristica;
$caracteristica->setEvaluacion($this);
}
return $this;
}
public function removeCaracteristica(Caracteristica $caracteristica): self
{
if ($this->caracteristicas->contains($caracteristica)) {
$this->caracteristicas->removeElement($caracteristica);
// set the owning side to null (unless already changed)
if ($caracteristica->getEvaluacion() === $this) {
$caracteristica->setEvaluacion(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->setEvaluacion($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->getEvaluacion() === $this) {
$registroEvaluacione->setEvaluacion(null);
}
}
return $this;
}
public function getColor(): ?Color
{
return $this->color;
}
public function setColor(?Color $color): self
{
$this->color = $color;
return $this;
}
public function getPublico(): ?bool
{
return $this->publico;
}
public function setPublico(bool $publico): self
{
$this->publico = $publico;
return $this;
}
}