src/Entity/Convocatoria.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ConvocatoriaRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassConvocatoriaRepository::class)]
  7. class Convocatoria
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\Column(type'string'length255nullable:falseuniquetrue)]
  14.     private $nombre;
  15.     #[ORM\Column(type'string'length255nullable:falseuniquefalse)]
  16.     private $anio;
  17.     #[ORM\Column(type'boolean'nullable:true)]
  18.     private $admisibilidad_activa null;
  19.     #[ORM\Column(type'boolean'nullable:true)]
  20.     private $evaluacion_activa null;
  21.     #[ORM\Column(type'string'nullabletrue)]
  22.     private $estado;
  23.     public function getId(): ?int
  24.     {
  25.         return $this->id;
  26.     }
  27.     public function getNombre(): ?string
  28.     {
  29.         return $this->nombre;
  30.     }
  31.     public function setNombre(?string $nombre): self
  32.     {
  33.         $this->nombre $nombre;
  34.         return $this;
  35.     }
  36.     public function getAnio(): ?string
  37.         {
  38.             return $this->anio;
  39.         }
  40.     public function setAnio(?string $anio): self
  41.         {
  42.             $this->anio $anio;
  43.             return $this;
  44.         }
  45.     public function __toString(){
  46.         return $this->getNombre();
  47.     }
  48.     public function isAdmisibilidadActiva(): ?bool
  49.     {
  50.         return $this->admisibilidad_activa;
  51.     }
  52.     public function setAdmisibilidadActiva(?bool $admisibilidad_activa): self
  53.     {
  54.         $this->admisibilidad_activa $admisibilidad_activa;
  55.         return $this;
  56.     }
  57.     public function isEvaluacionActiva(): ?bool
  58.     {
  59.         return $this->evaluacion_activa;
  60.     }
  61.     public function setEvaluacionActiva(?bool $evaluacion_activa): self
  62.     {
  63.         $this->evaluacion_activa $evaluacion_activa;
  64.         return $this;
  65.     }
  66.     public function getEstado(): ?string
  67.     {
  68.         if($this->estado == '2'){
  69.             return 'En evaluación';
  70.         } else if ($this->estado == '1') {
  71.             return 'En postulación';
  72.         } else {
  73.             return 'Cerrada';
  74.         }
  75.     }
  76.     public function setEstado(?string $estado): self
  77.     {
  78.         if($estado == 'En postulación'){
  79.             $this->estado '1';
  80.         } else if($estado == 'En evaluación'){
  81.             $this->estado '2';
  82.         } else {
  83.             $this->estado '3';
  84.         }
  85.         return $this;
  86.     }
  87. }