<?php
namespace App\Entity;
use App\Repository\ParTipoExamenRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ParTipoExamenRepository::class)]
class ParTipoExamen
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 100)]
private ?string $nombre = null;
#[ORM\ManyToOne(inversedBy: 'idTipoExamen')]
private ?ParEstado $estadoId = null;
#[ORM\OneToMany(mappedBy: 'tipoExamen', targetEntity: GHExamenPeriodico::class)]
private Collection $examenPeriodico;
public function __toString(): string {
return "{$this->getNombre()}";
}
public function __construct()
{
$this->tipoExamenId = new ArrayCollection();
$this->examenPeriodico = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(string $nombre): static
{
$this->nombre = $nombre;
return $this;
}
public function getEstadoId(): ?ParEstado
{
return $this->estadoId;
}
public function setEstadoId(?ParEstado $estadoId): static
{
$this->estadoId = $estadoId;
return $this;
}
/**
* @return Collection<int, GHExamenPeriodico>
*/
public function getExamenPeriodico(): Collection
{
return $this->examenPeriodico;
}
public function addExamenPeriodico(GHExamenPeriodico $examenPeriodico): static
{
if (!$this->examenPeriodico->contains($examenPeriodico)) {
$this->examenPeriodico->add($examenPeriodico);
$examenPeriodico->setTipoExamen($this);
}
return $this;
}
public function removeExamenPeriodico(GHExamenPeriodico $examenPeriodico): static
{
if ($this->examenPeriodico->removeElement($examenPeriodico)) {
// set the owning side to null (unless already changed)
if ($examenPeriodico->getTipoExamen() === $this) {
$examenPeriodico->setTipoExamen(null);
}
}
return $this;
}
}