src/Entity/Unidad.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Serializer\Annotation\Groups;
  5. /**
  6.  * Unidad
  7.  *
  8.  * @ORM\Table(name="unidad")
  9.  * @ORM\Entity
  10.  */
  11. class Unidad
  12. {
  13.     # -------------------------------------------------------------------------------------------------------- VARIABLES
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id_uni", type="integer", nullable=false)
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="IDENTITY")
  20.      * @Groups({"api_read"})
  21.      */
  22.     private $idUni;
  23.     /**
  24.      * @var string
  25.      *
  26.      * @ORM\Column(name="nombre", type="string", length=50, nullable=false)
  27.      * @Groups({"api_read"})
  28.      */
  29.     private $nombre;
  30.     /**
  31.      * @var int|null
  32.      *
  33.      * @ORM\Column(name="consecutivo", type="integer", nullable=true)
  34.      */
  35.     private $consecutivo;
  36.     /**
  37.      * @var bool
  38.      *
  39.      * @ORM\Column(name="activa", type="boolean", options={"default" : true})
  40.      */
  41.     private $activa;
  42.     /**
  43.      * @var int|null
  44.      *
  45.      * @ORM\Column(name="matricula", type="integer", nullable=true)
  46.      */
  47.     private ?int $matricula null;
  48.     /**
  49.      * @var int|null
  50.      *
  51.      * @ORM\Column(name="mat_ti", type="integer", nullable=true)
  52.      */
  53.     private ?int $matTi null;
  54.     /**
  55.      * @var string
  56.      *
  57.      * @ORM\Column(name="director", type="string", length=50, nullable=false)
  58.      */
  59.     private $director;
  60.     /**
  61.      * @var string
  62.      *
  63.      * @ORM\Column(name="sexo", type="string", length=1, nullable=false)
  64.      */
  65.     private $sexo;
  66.     /**
  67.      * @var string
  68.      *
  69.      * @ORM\Column(name="telefono", type="string", length=46, nullable=false)
  70.      */
  71.     private $telefono;
  72.     /**
  73.      * @var string
  74.      *
  75.      * @ORM\Column(name="correo", type="string", length=36, nullable=false)
  76.      */
  77.     private $correo;
  78.     /**
  79.      * @var string
  80.      *
  81.      * @ORM\Column(name="calle", type="string", length=80, nullable=false)
  82.      */
  83.     private $calle;
  84.     /**
  85.      * @var string
  86.      *
  87.      * @ORM\Column(name="colonia", type="string", length=60, nullable=true)
  88.      */
  89.     private $colonia;
  90.     /**
  91.      * @var string
  92.      *
  93.      * @ORM\Column(name="municipio", type="string", length=30, nullable=false)
  94.      * @Groups({"api_read"})
  95.      */
  96.     private $municipio;
  97.     /**
  98.      * @var string
  99.      *
  100.      * @ORM\Column(name="cp", type="string", length=5, nullable=false)
  101.      */
  102.     private $cp;
  103.     // Métodos getter y setter para los campos nuevos:
  104.     public function getMatricula(): ?int
  105.     {
  106.         return $this->matricula;
  107.     }
  108.     public function setMatricula(?int $matricula): self
  109.     {
  110.         $this->matricula $matricula;
  111.         return $this;
  112.     }
  113.     public function getMatTi(): ?int
  114.     {
  115.         return $this->matTi;
  116.     }
  117.     public function setMatTi(?int $matTi): self
  118.     {
  119.         $this->matTi $matTi;
  120.         return $this;
  121.     }
  122.     # ---------------------------------------------------------------------------------------------------------- MÉTODOS
  123.     public function __toString()
  124.     {
  125.         return $this->nombre;
  126.     }
  127.     # ---------------------------------------------------------------------------------------------- GETTERS AND SETTERS
  128.     public function getIdUni(): ?int
  129.     {
  130.         return $this->idUni;
  131.     }
  132.     public function getNombre(): ?string
  133.     {
  134.         return $this->nombre;
  135.     }
  136.     public function setNombre(string $nombre): self
  137.     {
  138.         $this->nombre $nombre;
  139.         return $this;
  140.     }
  141.     public function getConsecutivo(): ?int
  142.     {
  143.         return $this->consecutivo;
  144.     }
  145.     public function setConsecutivo(?int $consecutivo): self
  146.     {
  147.         $this->consecutivo $consecutivo;
  148.         return $this;
  149.     }
  150.     public function getActiva(): ?bool
  151.     {
  152.         return $this->activa;
  153.     }
  154.     public function setActiva(bool $activa): self
  155.     {
  156.         $this->activa $activa;
  157.         return $this;
  158.     }
  159.     
  160.     public function getDirector(): ?string
  161.     {
  162.         return $this->director;
  163.     }
  164.     public function setDirector(string $director): self
  165.     {
  166.         $this->director $director;
  167.         return $this;
  168.     }
  169.     public function getSexo(): ?string
  170.     {
  171.         return $this->sexo;
  172.     }
  173.     public function setSexo(string $sexo): self
  174.     {
  175.         $this->sexo $sexo;
  176.         return $this;
  177.     }
  178.     public function getTelefono(): ?string
  179.     {
  180.         return $this->telefono;
  181.     }
  182.     public function setTelefono(string $telefono): self
  183.     {
  184.         $this->telefono $telefono;
  185.         return $this;
  186.     }
  187.     public function getCorreo(): ?string
  188.     {
  189.         return $this->correo;
  190.     }
  191.     public function setCorreo(string $correo): self
  192.     {
  193.         $this->correo $correo;
  194.         return $this;
  195.     }
  196.     public function getCalle(): ?string
  197.     {
  198.         return $this->calle;
  199.     }
  200.     public function setCalle(string $calle): self
  201.     {
  202.         $this->calle $calle;
  203.         return $this;
  204.     }
  205.     public function getColonia(): ?string
  206.     {
  207.         return $this->colonia;
  208.     }
  209.     public function setColonia(string $colonia): self
  210.     {
  211.         $this->colonia $colonia;
  212.         return $this;
  213.     }
  214.     public function getMunicipio(): ?string
  215.     {
  216.         return $this->municipio;
  217.     }
  218.     public function setMunicipio(string $municipio): self
  219.     {
  220.         $this->municipio $municipio;
  221.         return $this;
  222.     }
  223.     public function getCP(): ?string
  224.     {
  225.         return $this->cp;
  226.     }
  227.     public function setCP(string $cp): self
  228.     {
  229.         $this->cp $cp;
  230.         return $this;
  231.     }
  232.  
  233. // Entidad de unidad
  234. }