src/Entity/RedSocial.php line 15

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