src/Entity/Unidad.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UnidadRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=UnidadRepository::class)
  9.  */
  10. class Unidad
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $nombre;
  22.     /**
  23.      * @ORM\Column(type="boolean")
  24.      */
  25.     private $estado;
  26.     /**
  27.      * @ORM\Column(type="string", length=50)
  28.      */
  29.     private $ip_crea;
  30.     /**
  31.      * @ORM\Column(type="string", length=50)
  32.      */
  33.     private $ip_modifica;
  34.     /**
  35.      * @ORM\Column(type="integer")
  36.      */
  37.     private $user_crea;
  38.     /**
  39.      * @ORM\Column(type="integer")
  40.      */
  41.     private $user_modifica;
  42.     /**
  43.      * @ORM\Column(type="datetime")
  44.      */
  45.     private $created_at;
  46.     /**
  47.      * @ORM\Column(type="datetime")
  48.      */
  49.     private $updated_at;
  50.     /**
  51.      * @ORM\OneToMany(targetEntity=Sala::class, mappedBy="unidad")
  52.      */
  53.     private $salas;
  54.     public function __construct()
  55.     {
  56.         $this->salas = new ArrayCollection();
  57.     }
  58.     public function getId(): ?int
  59.     {
  60.         return $this->id;
  61.     }
  62.     public function getNombre(): ?string
  63.     {
  64.         return $this->nombre;
  65.     }
  66.     public function setNombre(string $nombre): self
  67.     {
  68.         $this->nombre $nombre;
  69.         return $this;
  70.     }
  71.     public function getEstado(): ?bool
  72.     {
  73.         return $this->estado;
  74.     }
  75.     public function setEstado(bool $estado): self
  76.     {
  77.         $this->estado $estado;
  78.         return $this;
  79.     }
  80.     public function getIpCrea(): ?string
  81.     {
  82.         return $this->ip_crea;
  83.     }
  84.     public function setIpCrea(string $ip_crea): self
  85.     {
  86.         $this->ip_crea $ip_crea;
  87.         return $this;
  88.     }
  89.     public function getIpModifica(): ?string
  90.     {
  91.         return $this->ip_modifica;
  92.     }
  93.     public function setIpModifica(string $ip_modifica): self
  94.     {
  95.         $this->ip_modifica $ip_modifica;
  96.         return $this;
  97.     }
  98.     public function getUserCrea(): ?int
  99.     {
  100.         return $this->user_crea;
  101.     }
  102.     public function setUserCrea(int $user_crea): self
  103.     {
  104.         $this->user_crea $user_crea;
  105.         return $this;
  106.     }
  107.     public function getUserModifica(): ?int
  108.     {
  109.         return $this->user_modifica;
  110.     }
  111.     public function setUserModifica(int $user_modifica): self
  112.     {
  113.         $this->user_modifica $user_modifica;
  114.         return $this;
  115.     }
  116.     public function getCreatedAt(): ?\DateTimeInterface
  117.     {
  118.         return $this->created_at;
  119.     }
  120.     public function setCreatedAt(\DateTimeInterface $created_at): self
  121.     {
  122.         $this->created_at $created_at;
  123.         return $this;
  124.     }
  125.     public function getUpdatedAt(): ?\DateTimeInterface
  126.     {
  127.         return $this->updated_at;
  128.     }
  129.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  130.     {
  131.         $this->updated_at $updated_at;
  132.         return $this;
  133.     }
  134.     /**
  135.      * @return Collection|Sala[]
  136.      */
  137.     public function getSalas(): Collection
  138.     {
  139.         return $this->salas;
  140.     }
  141.     public function addSala(Sala $sala): self
  142.     {
  143.         if (!$this->salas->contains($sala)) {
  144.             $this->salas[] = $sala;
  145.             $sala->setUnidad($this);
  146.         }
  147.         return $this;
  148.     }
  149.     public function removeSala(Sala $sala): self
  150.     {
  151.         if ($this->salas->contains($sala)) {
  152.             $this->salas->removeElement($sala);
  153.             // set the owning side to null (unless already changed)
  154.             if ($sala->getUnidad() === $this) {
  155.                 $sala->setUnidad(null);
  156.             }
  157.         }
  158.         return $this;
  159.     }
  160. }