src/Entity/Periodo.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\Unique;
  6. /**
  7.  * Periodo
  8.  *
  9.  * @ORM\Table(name="periodo")
  10.  * @ORM\Entity
  11.  * @UniqueEntity(fields={"idPrd"}, message="Existe un periodo registrado con el mismo Idantificador")
  12.  */
  13. class Periodo
  14. {
  15.     # -------------------------------------------------------------------------------------------------------- VARIABLES
  16.     /**
  17.      * @var string
  18.      *
  19.      * @ORM\Column(name="id_prd", type="string", length=6, nullable=true)
  20.      * @ORM\Id
  21.      */
  22.     //@ORM\GeneratedValue(strategy="IDENTITY")
  23.     private $idPrd;
  24.     /**
  25.      * @var string|null
  26.      *
  27.      * @ORM\Column(name="nombre", type="string", length=10, nullable=true)
  28.      */
  29.     private $nombre;
  30.     
  31.     /**
  32.      * @var string|null
  33.      *
  34.      * @ORM\Column(name="descripcion", type="string", length=100, nullable=true)
  35.      */
  36.     private $descripcion;
  37.     /**
  38.      * @var bool|null
  39.      *
  40.      * @ORM\Column(name="actual", type="boolean", nullable=true)
  41.      */
  42.     private $actual;
  43.     /**
  44.      * @var bool|null
  45.      *
  46.      * @ORM\Column(name="activo", type="boolean", nullable=false)
  47.      */
  48.     private $activo;# = 1
  49.     # ---------------------------------------------------------------------------------------------------------- MÉTODOS
  50.     public function __toString()
  51.     {
  52.         return $this->nombre;
  53.     }
  54.     # ---------------------------------------------------------------------------------------------- GETTERS AND SETTERS
  55.     public function getIdPrd(): ?string
  56.     {
  57.         return $this->idPrd;
  58.     }
  59.     public function setIdPrd(?string $idPrd): self
  60.     {
  61.         $this->idPrd $idPrd;
  62.         return $this;
  63.     }
  64.     public function getNombre(): ?string
  65.     {
  66.         return $this->nombre;
  67.     }
  68.     public function setNombre(?string $nombre): self
  69.     {
  70.         $this->nombre $nombre;
  71.         return $this;
  72.     }
  73.     
  74.     public function getDescripcion(): ?string
  75.     {
  76.         return $this->descripcion;
  77.     }
  78.     public function setDescripcion(?string $descripcion): self
  79.     {
  80.         $this->descripcion $descripcion;
  81.         return $this;
  82.     }
  83.     public function getActual(): ?bool
  84.     {
  85.         return $this->actual;
  86.     }
  87.     public function setActual(?bool $actual): self
  88.     {
  89.         $this->actual $actual;
  90.         return $this;
  91.     }
  92.     public function getActivo(): ?bool
  93.     {
  94.         return $this->activo;
  95.     }
  96.     public function setActivo(?bool $activo): self
  97.     {
  98.         $this->activo $activo;
  99.         return $this;
  100.     }
  101. }