src/Entity/LabProtocolo.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LabProtocoloRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use DateTime;
  8. /**
  9.  * @ORM\Entity(repositoryClass=LabProtocoloRepository::class)
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class LabProtocolo
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $nombre;
  24.     /**
  25.      * @ORM\Column(type="string", length=50)
  26.      */
  27.     private $estado;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="labProtocolos")
  30.      * @ORM\JoinColumn(nullable=false)
  31.      */
  32.     private $doctor;
  33.     /**
  34.      * @ORM\Column(type="string", length=50)
  35.      */
  36.     private $ip_crea;
  37.     /**
  38.      * @ORM\Column(type="string", length=50)
  39.      */
  40.     private $ip_modifica;
  41.     /**
  42.      * @ORM\Column(type="integer")
  43.      */
  44.     private $user_crea;
  45.     /**
  46.      * @ORM\Column(type="integer")
  47.      */
  48.     private $user_modifica;
  49.     /**
  50.      * @ORM\Column(type="datetime")
  51.      */
  52.     private $created_at;
  53.     /**
  54.      * @ORM\Column(type="datetime")
  55.      */
  56.     private $updated_at;
  57.     /**
  58.      * @ORM\OneToMany(targetEntity=LabProtocoloExamen::class, mappedBy="protocolo")
  59.      */
  60.     private $labProtocoloExamens;
  61.     public function __construct()
  62.     {
  63.         $this->labProtocoloExamens = new ArrayCollection();
  64.     }
  65.     public function getId(): ?int
  66.     {
  67.         return $this->id;
  68.     }
  69.     public function getNombre(): ?string
  70.     {
  71.         return $this->nombre;
  72.     }
  73.     public function setNombre(string $nombre): self
  74.     {
  75.         $this->nombre $nombre;
  76.         return $this;
  77.     }
  78.     public function getEstado(): ?string
  79.     {
  80.         return $this->estado;
  81.     }
  82.     public function setEstado(string $estado): self
  83.     {
  84.         $this->estado $estado;
  85.         return $this;
  86.     }
  87.     public function getDoctor(): ?User
  88.     {
  89.         return $this->doctor;
  90.     }
  91.     public function setDoctor(?User $doctor): self
  92.     {
  93.         $this->doctor $doctor;
  94.         return $this;
  95.     }
  96.     public function getIpCrea(): ?string
  97.     {
  98.         return $this->ip_crea;
  99.     }
  100.     public function setIpCrea(string $ip_crea): self
  101.     {
  102.         $this->ip_crea $ip_crea;
  103.         return $this;
  104.     }
  105.     public function getIpModifica(): ?string
  106.     {
  107.         return $this->ip_modifica;
  108.     }
  109.     public function setIpModifica(string $ip_modifica): self
  110.     {
  111.         $this->ip_modifica $ip_modifica;
  112.         return $this;
  113.     }
  114.     public function getUserCrea(): ?int
  115.     {
  116.         return $this->user_crea;
  117.     }
  118.     public function setUserCrea(int $user_crea): self
  119.     {
  120.         $this->user_crea $user_crea;
  121.         return $this;
  122.     }
  123.     public function getUserModifica(): ?int
  124.     {
  125.         return $this->user_modifica;
  126.     }
  127.     public function setUserModifica(int $user_modifica): self
  128.     {
  129.         $this->user_modifica $user_modifica;
  130.         return $this;
  131.     }
  132.     public function getCreatedAt(): ?\DateTimeInterface
  133.     {
  134.         return $this->created_at;
  135.     }
  136.     public function setCreatedAt(\DateTimeInterface $created_at): self
  137.     {
  138.         $this->created_at $created_at;
  139.         return $this;
  140.     }
  141.     public function getUpdatedAt(): ?\DateTimeInterface
  142.     {
  143.         return $this->updated_at;
  144.     }
  145.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  146.     {
  147.         $this->updated_at $updated_at;
  148.         return $this;
  149.     }
  150.     /**
  151.      * @ORM\PrePersist
  152.      * @ORM\PreUpdate
  153.      */
  154.     public function updatedTimestamps(): void
  155.     {
  156.         $dateTimeNow = new DateTime('now');
  157.         $this->setUpdatedAt($dateTimeNow);
  158.         if ($this->getCreatedAt() === null) {
  159.             $this->setCreatedAt($dateTimeNow);
  160.         }
  161.     }
  162.     /**
  163.      * @return Collection|LabProtocoloExamen[]
  164.      */
  165.     public function getLabProtocoloExamens(): Collection
  166.     {
  167.         return $this->labProtocoloExamens;
  168.     }
  169.     public function addLabProtocoloExamen(LabProtocoloExamen $labProtocoloExamen): self
  170.     {
  171.         if (!$this->labProtocoloExamens->contains($labProtocoloExamen)) {
  172.             $this->labProtocoloExamens[] = $labProtocoloExamen;
  173.             $labProtocoloExamen->setProtocolo($this);
  174.         }
  175.         return $this;
  176.     }
  177.     public function removeLabProtocoloExamen(LabProtocoloExamen $labProtocoloExamen): self
  178.     {
  179.         if ($this->labProtocoloExamens->removeElement($labProtocoloExamen)) {
  180.             // set the owning side to null (unless already changed)
  181.             if ($labProtocoloExamen->getProtocolo() === $this) {
  182.                 $labProtocoloExamen->setProtocolo(null);
  183.             }
  184.         }
  185.         return $this;
  186.     }
  187. }