src/Entity/Procedimientos.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProcedimientosRepository;
  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=ProcedimientosRepository::class)
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class Procedimientos
  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=255)
  26.      */
  27.     private $observacion;
  28.     /**
  29.      * @ORM\Column(type="boolean")
  30.      */
  31.     private $estado;
  32.     /**
  33.      * @ORM\Column(type="string", length=50)
  34.      */
  35.     private $ip_crea;
  36.     /**
  37.      * @ORM\Column(type="string", length=50)
  38.      */
  39.     private $ip_modifica;
  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="datetime")
  50.      */
  51.     private $created_at;
  52.     /**
  53.      * @ORM\Column(type="datetime")
  54.      */
  55.     private $updated_at;
  56.     /**
  57.      * @ORM\OneToMany(targetEntity=Agenda::class, mappedBy="procedimiento")
  58.      */
  59.     private $agendas;
  60.     /**
  61.      * @ORM\Column(type="string", length=100, nullable=true)
  62.      */
  63.     private $tipo;
  64.     /**
  65.      * @ORM\OneToMany(targetEntity=Estudio::class, mappedBy="procedimiento")
  66.      */
  67.     private $estudios;
  68.     
  69.     /**
  70.      * @ORM\OneToMany(targetEntity=OrdenProcedimiento::class, mappedBy="procedimiento")
  71.      */
  72.     private $ordenProcedimientos;
  73.     
  74.     /**
  75.      * @ORM\OneToMany(targetEntity=OdontogramaProcedimiento::class, mappedBy="procedimiento")
  76.      */
  77.     private $odontogramaProcedimientos;
  78.     /**
  79.      * @ORM\Column(type="string", length=50, nullable=true)
  80.      */
  81.     private $imagen;
  82.     
  83.     /**
  84.      * @ORM\OneToOne(targetEntity=Producto::class)
  85.      * @ORM\JoinColumn(name="producto_id", referencedColumnName="id", nullable=true)
  86.      */
  87.     private $producto;
  88.     /**
  89.      * @ORM\ManyToOne(targetEntity=Especialidad::class, inversedBy="agendas")
  90.      * @ORM\JoinColumn(nullable=false)
  91.      */
  92.     private $especialidad;
  93.     /**
  94.      * @ORM\Column(type="string", length=10, nullable=true)
  95.      */
  96.     private $colorActivo;
  97.     /**
  98.      * @ORM\Column(type="string", length=10, nullable=true)
  99.      */
  100.     private $colorInactivo;
  101.     public function __construct()
  102.     {
  103.         $this->agendas = new ArrayCollection();
  104.         $this->estudios = new ArrayCollection();
  105.         $this->ordenProcedimientos = new ArrayCollection();
  106.         $this->odontogramaProcedimientos = new ArrayCollection();
  107.     }
  108.     public function getId(): ?int
  109.     {
  110.         return $this->id;
  111.     }
  112.     public function getNombre(): ?string
  113.     {
  114.         return $this->nombre;
  115.     }
  116.     public function setNombre(string $nombre): self
  117.     {
  118.         $this->nombre $nombre;
  119.         return $this;
  120.     }
  121.     public function getObservacion(): ?string
  122.     {
  123.         return $this->observacion;
  124.     }
  125.     public function setObservacion(string $observacion): self
  126.     {
  127.         $this->observacion $observacion;
  128.         return $this;
  129.     }
  130.     public function getEstado(): ?bool
  131.     {
  132.         return $this->estado;
  133.     }
  134.     public function setEstado(bool $estado): self
  135.     {
  136.         $this->estado $estado;
  137.         return $this;
  138.     }
  139.     public function getIpCrea(): ?string
  140.     {
  141.         return $this->ip_crea;
  142.     }
  143.     public function setIpCrea(string $ip_crea): self
  144.     {
  145.         $this->ip_crea $ip_crea;
  146.         return $this;
  147.     }
  148.     public function getIpModifica(): ?string
  149.     {
  150.         return $this->ip_modifica;
  151.     }
  152.     public function setIpModifica(string $ip_modifica): self
  153.     {
  154.         $this->ip_modifica $ip_modifica;
  155.         return $this;
  156.     }
  157.     public function getUserCrea(): ?int
  158.     {
  159.         return $this->user_crea;
  160.     }
  161.     public function setUserCrea(int $user_crea): self
  162.     {
  163.         $this->user_crea $user_crea;
  164.         return $this;
  165.     }
  166.     public function getUserModifica(): ?int
  167.     {
  168.         return $this->user_modifica;
  169.     }
  170.     public function setUserModifica(int $user_modifica): self
  171.     {
  172.         $this->user_modifica $user_modifica;
  173.         return $this;
  174.     }
  175.     public function getCreatedAt(): ?\DateTimeInterface
  176.     {
  177.         return $this->created_at;
  178.     }
  179.     public function setCreatedAt(\DateTimeInterface $created_at): self
  180.     {
  181.         $this->created_at $created_at;
  182.         return $this;
  183.     }
  184.     public function getUpdatedAt(): ?\DateTimeInterface
  185.     {
  186.         return $this->updated_at;
  187.     }
  188.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  189.     {
  190.         $this->updated_at $updated_at;
  191.         return $this;
  192.     }
  193.     /**
  194.      * @ORM\PrePersist
  195.      * @ORM\PreUpdate
  196.      */
  197.     public function updatedTimestamps(): void
  198.     {
  199.         $dateTimeNow = new DateTime('now');
  200.         $this->setUpdatedAt($dateTimeNow);
  201.         if ($this->getCreatedAt() === null) {
  202.             $this->setCreatedAt($dateTimeNow);
  203.         }
  204.     }
  205.     /**
  206.      * @return Collection|Agenda[]
  207.      */
  208.     public function getAgendas(): Collection
  209.     {
  210.         return $this->agendas;
  211.     }
  212.     public function addAgenda(Agenda $agenda): self
  213.     {
  214.         if (!$this->agendas->contains($agenda)) {
  215.             $this->agendas[] = $agenda;
  216.             $agenda->setProcedimiento($this);
  217.         }
  218.         return $this;
  219.     }
  220.     public function removeAgenda(Agenda $agenda): self
  221.     {
  222.         if ($this->agendas->removeElement($agenda)) {
  223.             // set the owning side to null (unless already changed)
  224.             if ($agenda->getProcedimiento() === $this) {
  225.                 $agenda->setProcedimiento(null);
  226.             }
  227.         }
  228.         return $this;
  229.     }
  230.     public function getTipo(): ?string
  231.     {
  232.         return $this->tipo;
  233.     }
  234.     public function setTipo(string $tipo): self
  235.     {
  236.         $this->tipo $tipo;
  237.         return $this;
  238.     }
  239.     /**
  240.      * @return Collection|Estudio[]
  241.      */
  242.     public function getEstudios(): Collection
  243.     {
  244.         return $this->estudios;
  245.     }
  246.     public function addEstudio(Estudio $estudio): self
  247.     {
  248.         if (!$this->estudios->contains($estudio)) {
  249.             $this->estudios[] = $estudio;
  250.             $estudio->setProcedimiento($this);
  251.         }
  252.         return $this;
  253.     }
  254.     public function removeEstudio(Estudio $estudio): self
  255.     {
  256.         if ($this->estudios->removeElement($estudio)) {
  257.             // set the owning side to null (unless already changed)
  258.             if ($estudio->getProcedimiento() === $this) {
  259.                 $estudio->setProcedimiento(null);
  260.             }
  261.         }
  262.         return $this;
  263.     }
  264.     
  265.     /**
  266.      * @return Collection|OrdenProcedimiento[]
  267.      */
  268.     public function getOrdenProcedimientos(): Collection
  269.     {
  270.         return $this->ordenProcedimientos;
  271.     }
  272.     public function addOrdenProcedimiento(OrdenProcedimiento $ordenProcedimiento): self
  273.     {
  274.         if (!$this->ordenProcedimientos->contains($ordenProcedimiento)) {
  275.             $this->ordenProcedimientos[] = $ordenProcedimiento;
  276.             $ordenProcedimiento->setProcedimiento($this);
  277.         }
  278.         return $this;
  279.     }
  280.     public function removeOrdenProcedimiento(OrdenProcedimiento $ordenProcedimiento): self
  281.     {
  282.         if ($this->ordenProcedimientos->removeElement($ordenProcedimiento)) {
  283.             // set the owning side to null (unless already changed)
  284.             if ($ordenProcedimiento->getProcedimiento() === $this) {
  285.                 $ordenProcedimiento->setProcedimiento(null);
  286.             }
  287.         }
  288.         return $this;
  289.     }
  290.     
  291.     /**
  292.      * @return Collection|OdontogramaProcedimiento[]
  293.      */
  294.     public function getOdontogramaProcedimientos(): Collection
  295.     {
  296.         return $this->odontogramaProcedimientos;
  297.     }
  298.     public function addOdontogramaProcedimiento(OdontogramaProcedimiento $odontogramaProcedimiento): self
  299.     {
  300.         if (!$this->odontogramaProcedimientos->contains($odontogramaProcedimiento)) {
  301.             $this->odontogramaProcedimientos[] = $odontogramaProcedimiento;
  302.             $odontogramaProcedimiento->setProcedimiento($this);
  303.         }
  304.         return $this;
  305.     }
  306.     public function removeOdontogramaProcedimiento(OdontogramaProcedimiento $odontogramaProcedimiento): self
  307.     {
  308.         if ($this->odontogramaProcedimientos->removeElement($odontogramaProcedimiento)) {
  309.             // set the owning side to null (unless already changed)
  310.             if ($odontogramaProcedimiento->getProcedimiento() === $this) {
  311.                 $odontogramaProcedimiento->setProcedimiento(null);
  312.             }
  313.         }
  314.         return $this;
  315.     }
  316.     public function getImagen(): ?string
  317.     {
  318.         return $this->imagen;
  319.     }
  320.     public function setImagen(?string $imagen): self
  321.     {
  322.         $this->imagen $imagen;
  323.         return $this;
  324.     }
  325.     
  326.     public function getProducto(): ?Producto
  327.     {
  328.         return $this->producto;
  329.     }
  330.     
  331.     public function setProducto(?Producto $producto): self
  332.     {
  333.         $this->producto $producto;
  334.     
  335.         return $this;
  336.     }
  337.     public function getEspecialidad(): ?Especialidad
  338.     {
  339.         return $this->especialidad;
  340.     }
  341.     public function setEspecialidad(?Especialidad $especialidad): self
  342.     {
  343.         $this->especialidad $especialidad;
  344.         return $this;
  345.     }
  346.     public function getColorActivo(): ?string
  347.     {
  348.         return $this->colorActivo;
  349.     }
  350.     public function setColorActivo(?string $colorActivo): self
  351.     {
  352.         $this->colorActivo $colorActivo;
  353.         return $this;
  354.     }
  355.     public function getColorInactivo(): ?string
  356.     {
  357.         return $this->colorInactivo;
  358.     }
  359.     public function setColorInactivo(?string $colorInactivo): self
  360.     {
  361.         $this->colorInactivo $colorInactivo;
  362.         return $this;
  363.     }
  364. }