src/Entity/Sala.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SalaRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=SalaRepository::class)
  9.  */
  10. class Sala
  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\ManyToOne(targetEntity=Unidad::class, inversedBy="salas")
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $unidad;
  31.     /**
  32.      * @ORM\Column(type="string", length=50)
  33.      */
  34.     private $ip_crea;
  35.     /**
  36.      * @ORM\Column(type="string", length=50)
  37.      */
  38.     private $ip_modifica;
  39.     /**
  40.      * @ORM\Column(type="integer")
  41.      */
  42.     private $user_crea;
  43.     /**
  44.      * @ORM\Column(type="integer")
  45.      */
  46.     private $user_modifica;
  47.     /**
  48.      * @ORM\Column(type="datetime")
  49.      */
  50.     private $created_at;
  51.     /**
  52.      * @ORM\Column(type="datetime")
  53.      */
  54.     private $updated_at;
  55.     /**
  56.      * @ORM\OneToMany(targetEntity=Agenda::class, mappedBy="sala")
  57.      */
  58.     private $agendas;
  59.     /**
  60.      * @ORM\OneToMany(targetEntity=LogAgenda::class, mappedBy="sala")
  61.      */
  62.     private $logAgendas;
  63.     /**
  64.      * @ORM\Column(type="integer", nullable=true)
  65.      */
  66.     private $id_doctor;
  67.     public function __construct()
  68.     {
  69.         $this->agendas = new ArrayCollection();
  70.         $this->logAgendas = new ArrayCollection();
  71.     }
  72.     public function getId(): ?int
  73.     {
  74.         return $this->id;
  75.     }
  76.     public function getNombre(): ?string
  77.     {
  78.         return $this->nombre;
  79.     }
  80.     public function setNombre(string $nombre): self
  81.     {
  82.         $this->nombre $nombre;
  83.         return $this;
  84.     }
  85.     public function getEstado(): ?bool
  86.     {
  87.         return $this->estado;
  88.     }
  89.     public function setEstado(bool $estado): self
  90.     {
  91.         $this->estado $estado;
  92.         return $this;
  93.     }
  94.     public function getUnidad(): ?Unidad
  95.     {
  96.         return $this->unidad;
  97.     }
  98.     public function setUnidad(?Unidad $unidad): self
  99.     {
  100.         $this->unidad $unidad;
  101.         return $this;
  102.     }
  103.     public function getIpCrea(): ?string
  104.     {
  105.         return $this->ip_crea;
  106.     }
  107.     public function setIpCrea(string $ip_crea): self
  108.     {
  109.         $this->ip_crea $ip_crea;
  110.         return $this;
  111.     }
  112.     public function getIpModifica(): ?string
  113.     {
  114.         return $this->ip_modifica;
  115.     }
  116.     public function setIpModifica(string $ip_modifica): self
  117.     {
  118.         $this->ip_modifica $ip_modifica;
  119.         return $this;
  120.     }
  121.     public function getUserCrea(): ?int
  122.     {
  123.         return $this->user_crea;
  124.     }
  125.     public function setUserCrea(int $user_crea): self
  126.     {
  127.         $this->user_crea $user_crea;
  128.         return $this;
  129.     }
  130.     public function getUserModifica(): ?int
  131.     {
  132.         return $this->user_modifica;
  133.     }
  134.     public function setUserModifica(int $user_modifica): self
  135.     {
  136.         $this->user_modifica $user_modifica;
  137.         return $this;
  138.     }
  139.     public function getCreatedAt(): ?\DateTimeInterface
  140.     {
  141.         return $this->created_at;
  142.     }
  143.     public function setCreatedAt(\DateTimeInterface $created_at): self
  144.     {
  145.         $this->created_at $created_at;
  146.         return $this;
  147.     }
  148.     public function getUpdatedAt(): ?\DateTimeInterface
  149.     {
  150.         return $this->updated_at;
  151.     }
  152.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  153.     {
  154.         $this->updated_at $updated_at;
  155.         return $this;
  156.     }
  157.     /**
  158.      * @return Collection|Agenda[]
  159.      */
  160.     public function getAgendas(): Collection
  161.     {
  162.         return $this->agendas;
  163.     }
  164.     public function addAgenda(Agenda $agenda): self
  165.     {
  166.         if (!$this->agendas->contains($agenda)) {
  167.             $this->agendas[] = $agenda;
  168.             $agenda->setSala($this);
  169.         }
  170.         return $this;
  171.     }
  172.     public function removeAgenda(Agenda $agenda): self
  173.     {
  174.         if ($this->agendas->removeElement($agenda)) {
  175.             // set the owning side to null (unless already changed)
  176.             if ($agenda->getSala() === $this) {
  177.                 $agenda->setSala(null);
  178.             }
  179.         }
  180.         return $this;
  181.     }
  182.     public function __toString(){
  183.         // to show the name of the Category in the select
  184.         return $this->nombre;
  185.         // to show the id of the Category in the select
  186.         // return $this->id;
  187.     }
  188.     /**
  189.      * @return Collection|LogAgenda[]
  190.      */
  191.     public function getLogAgendas(): Collection
  192.     {
  193.         return $this->logAgendas;
  194.     }
  195.     public function addLogAgenda(LogAgenda $logAgenda): self
  196.     {
  197.         if (!$this->logAgendas->contains($logAgenda)) {
  198.             $this->logAgendas[] = $logAgenda;
  199.             $logAgenda->setSala($this);
  200.         }
  201.         return $this;
  202.     }
  203.     public function removeLogAgenda(LogAgenda $logAgenda): self
  204.     {
  205.         if ($this->logAgendas->removeElement($logAgenda)) {
  206.             // set the owning side to null (unless already changed)
  207.             if ($logAgenda->getSala() === $this) {
  208.                 $logAgenda->setSala(null);
  209.             }
  210.         }
  211.         return $this;
  212.     }
  213.     public function getIdDoctor(): ?int
  214.     {
  215.         return $this->id_doctor;
  216.     }
  217.     public function setIdDoctor(?int $id_doctor): self
  218.     {
  219.         $this->id_doctor $id_doctor;
  220.         return $this;
  221.     }
  222. }