src/Entity/ParTipoExamen.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParTipoExamenRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassParTipoExamenRepository::class)]
  8. class ParTipoExamen
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length100)]
  15.     private ?string $nombre null;
  16.     #[ORM\ManyToOne(inversedBy'idTipoExamen')]
  17.     private ?ParEstado $estadoId null;
  18.     #[ORM\OneToMany(mappedBy'tipoExamen'targetEntityGHExamenPeriodico::class)]
  19.     private Collection $examenPeriodico;
  20.     public function __toString(): string {
  21.         return "{$this->getNombre()}";
  22.     }
  23.     
  24.     public function __construct()
  25.     {
  26.         $this->tipoExamenId = new ArrayCollection();
  27.         $this->examenPeriodico = new ArrayCollection();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getNombre(): ?string
  34.     {
  35.         return $this->nombre;
  36.     }
  37.     public function setNombre(string $nombre): static
  38.     {
  39.         $this->nombre $nombre;
  40.         return $this;
  41.     }
  42.     public function getEstadoId(): ?ParEstado
  43.     {
  44.         return $this->estadoId;
  45.     }
  46.     public function setEstadoId(?ParEstado $estadoId): static
  47.     {
  48.         $this->estadoId $estadoId;
  49.         return $this;
  50.     }
  51.     /**
  52.      * @return Collection<int, GHExamenPeriodico>
  53.      */
  54.     public function getExamenPeriodico(): Collection
  55.     {
  56.         return $this->examenPeriodico;
  57.     }
  58.     public function addExamenPeriodico(GHExamenPeriodico $examenPeriodico): static
  59.     {
  60.         if (!$this->examenPeriodico->contains($examenPeriodico)) {
  61.             $this->examenPeriodico->add($examenPeriodico);
  62.             $examenPeriodico->setTipoExamen($this);
  63.         }
  64.         return $this;
  65.     }
  66.     public function removeExamenPeriodico(GHExamenPeriodico $examenPeriodico): static
  67.     {
  68.         if ($this->examenPeriodico->removeElement($examenPeriodico)) {
  69.             // set the owning side to null (unless already changed)
  70.             if ($examenPeriodico->getTipoExamen() === $this) {
  71.                 $examenPeriodico->setTipoExamen(null);
  72.             }
  73.         }
  74.         return $this;
  75.     }
  76. }