src/Entity/DiagnosticosHistoriaClinica.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DiagnosticosHistoriaClinicaRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use DateTime;
  6. /**
  7.  * @ORM\Entity(repositoryClass=DiagnosticosHistoriaClinicaRepository::class)
  8.  * @ORM\HasLifecycleCallbacks
  9.  */
  10. class DiagnosticosHistoriaClinica
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=HistoriaClinica::class, inversedBy="diagnosticosHistoriaClinicas")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $historia_clinica;
  23.     /**
  24.      * @ORM\Column(type="string", length=50)
  25.      */
  26.     private $tipo;
  27.     /**
  28.      * @ORM\Column(type="string", length=50)
  29.      */
  30.     private $ip_crea;
  31.     /**
  32.      * @ORM\Column(type="string", length=50)
  33.      */
  34.     private $ip_modifica;
  35.     /**
  36.      * @ORM\Column(type="integer")
  37.      */
  38.     private $user_crea;
  39.     /**
  40.      * @ORM\Column(type="integer")
  41.      */
  42.     private $user_modifica;
  43.     /**
  44.      * @ORM\Column(type="datetime")
  45.      */
  46.     private $created_at;
  47.     /**
  48.      * @ORM\Column(type="datetime")
  49.      */
  50.     private $updated_at;
  51.     /**
  52.      * @ORM\ManyToOne(targetEntity=Cie10::class, inversedBy="diagnosticosHistoriaClinicas")
  53.      * @ORM\JoinColumn(nullable=false)
  54.      */
  55.     private $cie10;
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getHistoriaClinica(): ?HistoriaClinica
  61.     {
  62.         return $this->historia_clinica;
  63.     }
  64.     public function setHistoriaClinica(?HistoriaClinica $historia_clinica): self
  65.     {
  66.         $this->historia_clinica $historia_clinica;
  67.         return $this;
  68.     }
  69.     public function getTipo(): ?string
  70.     {
  71.         return $this->tipo;
  72.     }
  73.     public function setTipo(string $tipo): self
  74.     {
  75.         $this->tipo $tipo;
  76.         return $this;
  77.     }
  78.     public function getIpCrea(): ?string
  79.     {
  80.         return $this->ip_crea;
  81.     }
  82.     public function setIpCrea(string $ip_crea): self
  83.     {
  84.         $this->ip_crea $ip_crea;
  85.         return $this;
  86.     }
  87.     public function getIpModifica(): ?string
  88.     {
  89.         return $this->ip_modifica;
  90.     }
  91.     public function setIpModifica(string $ip_modifica): self
  92.     {
  93.         $this->ip_modifica $ip_modifica;
  94.         return $this;
  95.     }
  96.     public function getUserCrea(): ?int
  97.     {
  98.         return $this->user_crea;
  99.     }
  100.     public function setUserCrea(int $user_crea): self
  101.     {
  102.         $this->user_crea $user_crea;
  103.         return $this;
  104.     }
  105.     public function getUserModifica(): ?int
  106.     {
  107.         return $this->user_modifica;
  108.     }
  109.     public function setUserModifica(int $user_modifica): self
  110.     {
  111.         $this->user_modifica $user_modifica;
  112.         return $this;
  113.     }
  114.     public function getCreatedAt(): ?\DateTimeInterface
  115.     {
  116.         return $this->created_at;
  117.     }
  118.     public function setCreatedAt(\DateTimeInterface $created_at): self
  119.     {
  120.         $this->created_at $created_at;
  121.         return $this;
  122.     }
  123.     public function getUpdatedAt(): ?\DateTimeInterface
  124.     {
  125.         return $this->updated_at;
  126.     }
  127.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  128.     {
  129.         $this->updated_at $updated_at;
  130.         return $this;
  131.     }
  132.     public function getCie10(): ?Cie10
  133.     {
  134.         return $this->cie10;
  135.     }
  136.     public function setCie10(?Cie10 $cie10): self
  137.     {
  138.         $this->cie10 $cie10;
  139.         return $this;
  140.     }
  141.     /**
  142.      * @ORM\PrePersist
  143.      * @ORM\PreUpdate
  144.      */
  145.     public function updatedTimestamps(): void
  146.     {
  147.         $dateTimeNow = new DateTime('now');
  148.         $this->setUpdatedAt($dateTimeNow);
  149.         if ($this->getCreatedAt() === null) {
  150.             $this->setCreatedAt($dateTimeNow);
  151.         }
  152.     }
  153. }