src/Entity/SeguroPrivado.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SeguroPrivadoRepository;
  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=SeguroPrivadoRepository::class)
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class SeguroPrivado
  13. {
  14.     /**
  15.      * @ORM\Id()
  16.      * @ORM\GeneratedValue()
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=100)
  22.      */
  23.     private $nombre;
  24.     /**
  25.      * @ORM\Column(type="boolean")
  26.      */
  27.     private $estado;
  28.     /**
  29.      * @ORM\Column(type="datetime")
  30.      */
  31.     private $created_at;
  32.     /**
  33.      * @ORM\Column(type="datetime")
  34.      */
  35.     private $updated_at;
  36.     /**
  37.      * @ORM\OneToMany(targetEntity=PlanoCabecera::class, mappedBy="seguroprivado")
  38.      */
  39.     private $planoCabeceras;
  40.     /**
  41.      * @ORM\Column(type="smallint")
  42.      */
  43.     private $tipo;
  44.     /**
  45.      * @ORM\Column(type="integer")
  46.      */
  47.     private $user_crea;
  48.     /**
  49.      * @ORM\Column(type="integer")
  50.      */
  51.     private $user_modifica;
  52.     /**
  53.      * @ORM\Column(type="string", length=50)
  54.      */
  55.     private $ip_crea;
  56.     /**
  57.      * @ORM\Column(type="string", length=50)
  58.      */
  59.     private $ip_modifica;
  60.     /**
  61.      * @ORM\OneToMany(targetEntity=Agenda::class, mappedBy="seguro")
  62.      */
  63.     private $agendas;
  64.     /**
  65.      * @ORM\OneToMany(targetEntity=Paciente::class, mappedBy="seguro")
  66.      */
  67.     private $pacientes;
  68.     /**
  69.      * @ORM\OneToMany(targetEntity=LogAgenda::class, mappedBy="seguro")
  70.      */
  71.     private $logAgendas;
  72.     /**
  73.      * @ORM\OneToMany(targetEntity=ExamenOrden::class, mappedBy="seguro")
  74.      */
  75.     private $examenOrdens;
  76.     /**
  77.      * @ORM\OneToMany(targetEntity=HdSolicitud::class, mappedBy="seguro")
  78.      */
  79.     private $hdSolicituds;
  80.     
  81.     /**
  82.      * @ORM\Column(type="string", length=10)
  83.      */
  84.     private $color;
  85.     public function __construct()
  86.     {
  87.         $this->planoCabeceras = new ArrayCollection();
  88.         $this->agendas = new ArrayCollection();
  89.         $this->pacientes = new ArrayCollection();
  90.         $this->logAgendas = new ArrayCollection();
  91.         $this->examenOrdens = new ArrayCollection();
  92.         $this->hdSolicituds = new ArrayCollection();
  93.     }
  94.     public function getId(): ?int
  95.     {
  96.         return $this->id;
  97.     }
  98.     public function getNombre(): ?string
  99.     {
  100.         return $this->nombre;
  101.     }
  102.     public function setNombre(string $nombre): self
  103.     {
  104.         $this->nombre $nombre;
  105.         return $this;
  106.     }
  107.     public function getEstado(): ?bool
  108.     {
  109.         return $this->estado;
  110.     }
  111.     public function setEstado(bool $estado): self
  112.     {
  113.         $this->estado $estado;
  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.     public function __toString(){
  135.         // to show the name of the Category in the select
  136.         return $this->nombre;
  137.         // to show the id of the Category in the select
  138.         // return $this->id;
  139.     }
  140.     /**
  141.      * @ORM\PrePersist
  142.      * @ORM\PreUpdate
  143.      */
  144.     public function updatedTimestamps(): void
  145.     {
  146.         $dateTimeNow = new DateTime('now');
  147.         $this->setUpdatedAt($dateTimeNow);
  148.         if ($this->getCreatedAt() === null) {
  149.             $this->setCreatedAt($dateTimeNow);
  150.         }
  151.     }
  152.     /**
  153.      * @return Collection|PlanoCabecera[]
  154.      */
  155.     public function getPlanoCabeceras(): Collection
  156.     {
  157.         return $this->planoCabeceras;
  158.     }
  159.     public function addPlanoCabecera(PlanoCabecera $planoCabecera): self
  160.     {
  161.         if (!$this->planoCabeceras->contains($planoCabecera)) {
  162.             $this->planoCabeceras[] = $planoCabecera;
  163.             $planoCabecera->setSeguroprivado($this);
  164.         }
  165.         return $this;
  166.     }
  167.     public function removePlanoCabecera(PlanoCabecera $planoCabecera): self
  168.     {
  169.         if ($this->planoCabeceras->contains($planoCabecera)) {
  170.             $this->planoCabeceras->removeElement($planoCabecera);
  171.             // set the owning side to null (unless already changed)
  172.             if ($planoCabecera->getSeguroprivado() === $this) {
  173.                 $planoCabecera->setSeguroprivado(null);
  174.             }
  175.         }
  176.         return $this;
  177.     }
  178.     public function getTipo(): ?int
  179.     {
  180.         return $this->tipo;
  181.     }
  182.     public function setTipo(int $tipo): self
  183.     {
  184.         $this->tipo $tipo;
  185.         return $this;
  186.     }
  187.     public function getUserCrea(): ?int
  188.     {
  189.         return $this->user_crea;
  190.     }
  191.     public function setUserCrea(int $user_crea): self
  192.     {
  193.         $this->user_crea $user_crea;
  194.         return $this;
  195.     }
  196.     public function getUserModifica(): ?int
  197.     {
  198.         return $this->user_modifica;
  199.     }
  200.     public function setUserModifica(int $user_modifica): self
  201.     {
  202.         $this->user_modifica $user_modifica;
  203.         return $this;
  204.     }
  205.     public function getIpCrea(): ?string
  206.     {
  207.         return $this->ip_crea;
  208.     }
  209.     public function setIpCrea(string $ip_crea): self
  210.     {
  211.         $this->ip_crea $ip_crea;
  212.         return $this;
  213.     }
  214.     public function getIpModifica(): ?string
  215.     {
  216.         return $this->ip_modifica;
  217.     }
  218.     public function setIpModifica(string $ip_modifica): self
  219.     {
  220.         $this->ip_modifica $ip_modifica;
  221.         return $this;
  222.     }
  223.     /**
  224.      * @return Collection|Agenda[]
  225.      */
  226.     public function getAgendas(): Collection
  227.     {
  228.         return $this->agendas;
  229.     }
  230.     public function addAgenda(Agenda $agenda): self
  231.     {
  232.         if (!$this->agendas->contains($agenda)) {
  233.             $this->agendas[] = $agenda;
  234.             $agenda->setSeguro($this);
  235.         }
  236.         return $this;
  237.     }
  238.     public function removeAgenda(Agenda $agenda): self
  239.     {
  240.         if ($this->agendas->removeElement($agenda)) {
  241.             // set the owning side to null (unless already changed)
  242.             if ($agenda->getSeguro() === $this) {
  243.                 $agenda->setSeguro(null);
  244.             }
  245.         }
  246.         return $this;
  247.     }
  248.     /**
  249.      * @return Collection|Paciente[]
  250.      */
  251.     public function getPacientes(): Collection
  252.     {
  253.         return $this->pacientes;
  254.     }
  255.     public function addPaciente(Paciente $paciente): self
  256.     {
  257.         if (!$this->pacientes->contains($paciente)) {
  258.             $this->pacientes[] = $paciente;
  259.             $paciente->setSeguro($this);
  260.         }
  261.         return $this;
  262.     }
  263.     public function removePaciente(Paciente $paciente): self
  264.     {
  265.         if ($this->pacientes->removeElement($paciente)) {
  266.             // set the owning side to null (unless already changed)
  267.             if ($paciente->getSeguro() === $this) {
  268.                 $paciente->setSeguro(null);
  269.             }
  270.         }
  271.         return $this;
  272.     }
  273.     /**
  274.      * @return Collection|LogAgenda[]
  275.      */
  276.     public function getLogAgendas(): Collection
  277.     {
  278.         return $this->logAgendas;
  279.     }
  280.     public function addLogAgenda(LogAgenda $logAgenda): self
  281.     {
  282.         if (!$this->logAgendas->contains($logAgenda)) {
  283.             $this->logAgendas[] = $logAgenda;
  284.             $logAgenda->setSeguro($this);
  285.         }
  286.         return $this;
  287.     }
  288.     public function removeLogAgenda(LogAgenda $logAgenda): self
  289.     {
  290.         if ($this->logAgendas->removeElement($logAgenda)) {
  291.             // set the owning side to null (unless already changed)
  292.             if ($logAgenda->getSeguro() === $this) {
  293.                 $logAgenda->setSeguro(null);
  294.             }
  295.         }
  296.         return $this;
  297.     }
  298.     /**
  299.      * @return Collection|ExamenOrden[]
  300.      */
  301.     public function getExamenOrdens(): Collection
  302.     {
  303.         return $this->examenOrdens;
  304.     }
  305.     public function addExamenOrden(ExamenOrden $examenOrden): self
  306.     {
  307.         if (!$this->examenOrdens->contains($examenOrden)) {
  308.             $this->examenOrdens[] = $examenOrden;
  309.             $examenOrden->setSeguro($this);
  310.         }
  311.         return $this;
  312.     }
  313.     public function removeExamenOrden(ExamenOrden $examenOrden): self
  314.     {
  315.         if ($this->examenOrdens->removeElement($examenOrden)) {
  316.             // set the owning side to null (unless already changed)
  317.             if ($examenOrden->getSeguro() === $this) {
  318.                 $examenOrden->setSeguro(null);
  319.             }
  320.         }
  321.         return $this;
  322.     }
  323.     /**
  324.      * @return Collection|HdSolicitud[]
  325.      */
  326.     public function getHdSolicituds(): Collection
  327.     {
  328.         return $this->hdSolicituds;
  329.     }
  330.     public function addHdSolicitud(HdSolicitud $hdSolicitud): self
  331.     {
  332.         if (!$this->hdSolicituds->contains($hdSolicitud)) {
  333.             $this->hdSolicituds[] = $hdSolicitud;
  334.             $hdSolicitud->setSeguro($this);
  335.         }
  336.         return $this;
  337.     }
  338.     public function removeHdSolicitud(HdSolicitud $hdSolicitud): self
  339.     {
  340.         if ($this->hdSolicituds->removeElement($hdSolicitud)) {
  341.             // set the owning side to null (unless already changed)
  342.             if ($hdSolicitud->getSeguro() === $this) {
  343.                 $hdSolicitud->setSeguro(null);
  344.             }
  345.         }
  346.         return $this;
  347.     }
  348.     
  349.     public function getColor(): ?string
  350.     {
  351.         return $this->color;
  352.     }
  353.     public function setColor(string $color): self
  354.     {
  355.         $this->color $color;
  356.         return $this;
  357.     }
  358. }