<?php
namespace App\Entity;
use App\Repository\ProcedimientosRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use DateTime;
/**
* @ORM\Entity(repositoryClass=ProcedimientosRepository::class)
* @ORM\HasLifecycleCallbacks
*/
class Procedimientos
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $nombre;
/**
* @ORM\Column(type="string", length=255)
*/
private $observacion;
/**
* @ORM\Column(type="boolean")
*/
private $estado;
/**
* @ORM\Column(type="string", length=50)
*/
private $ip_crea;
/**
* @ORM\Column(type="string", length=50)
*/
private $ip_modifica;
/**
* @ORM\Column(type="integer")
*/
private $user_crea;
/**
* @ORM\Column(type="integer")
*/
private $user_modifica;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime")
*/
private $updated_at;
/**
* @ORM\OneToMany(targetEntity=Agenda::class, mappedBy="procedimiento")
*/
private $agendas;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $tipo;
/**
* @ORM\OneToMany(targetEntity=Estudio::class, mappedBy="procedimiento")
*/
private $estudios;
/**
* @ORM\OneToMany(targetEntity=OrdenProcedimiento::class, mappedBy="procedimiento")
*/
private $ordenProcedimientos;
/**
* @ORM\OneToMany(targetEntity=OdontogramaProcedimiento::class, mappedBy="procedimiento")
*/
private $odontogramaProcedimientos;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $imagen;
/**
* @ORM\OneToOne(targetEntity=Producto::class)
* @ORM\JoinColumn(name="producto_id", referencedColumnName="id", nullable=true)
*/
private $producto;
/**
* @ORM\ManyToOne(targetEntity=Especialidad::class, inversedBy="agendas")
* @ORM\JoinColumn(nullable=false)
*/
private $especialidad;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private $colorActivo;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private $colorInactivo;
public function __construct()
{
$this->agendas = new ArrayCollection();
$this->estudios = new ArrayCollection();
$this->ordenProcedimientos = new ArrayCollection();
$this->odontogramaProcedimientos = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(string $nombre): self
{
$this->nombre = $nombre;
return $this;
}
public function getObservacion(): ?string
{
return $this->observacion;
}
public function setObservacion(string $observacion): self
{
$this->observacion = $observacion;
return $this;
}
public function getEstado(): ?bool
{
return $this->estado;
}
public function setEstado(bool $estado): self
{
$this->estado = $estado;
return $this;
}
public function getIpCrea(): ?string
{
return $this->ip_crea;
}
public function setIpCrea(string $ip_crea): self
{
$this->ip_crea = $ip_crea;
return $this;
}
public function getIpModifica(): ?string
{
return $this->ip_modifica;
}
public function setIpModifica(string $ip_modifica): self
{
$this->ip_modifica = $ip_modifica;
return $this;
}
public function getUserCrea(): ?int
{
return $this->user_crea;
}
public function setUserCrea(int $user_crea): self
{
$this->user_crea = $user_crea;
return $this;
}
public function getUserModifica(): ?int
{
return $this->user_modifica;
}
public function setUserModifica(int $user_modifica): self
{
$this->user_modifica = $user_modifica;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function updatedTimestamps(): void
{
$dateTimeNow = new DateTime('now');
$this->setUpdatedAt($dateTimeNow);
if ($this->getCreatedAt() === null) {
$this->setCreatedAt($dateTimeNow);
}
}
/**
* @return Collection|Agenda[]
*/
public function getAgendas(): Collection
{
return $this->agendas;
}
public function addAgenda(Agenda $agenda): self
{
if (!$this->agendas->contains($agenda)) {
$this->agendas[] = $agenda;
$agenda->setProcedimiento($this);
}
return $this;
}
public function removeAgenda(Agenda $agenda): self
{
if ($this->agendas->removeElement($agenda)) {
// set the owning side to null (unless already changed)
if ($agenda->getProcedimiento() === $this) {
$agenda->setProcedimiento(null);
}
}
return $this;
}
public function getTipo(): ?string
{
return $this->tipo;
}
public function setTipo(string $tipo): self
{
$this->tipo = $tipo;
return $this;
}
/**
* @return Collection|Estudio[]
*/
public function getEstudios(): Collection
{
return $this->estudios;
}
public function addEstudio(Estudio $estudio): self
{
if (!$this->estudios->contains($estudio)) {
$this->estudios[] = $estudio;
$estudio->setProcedimiento($this);
}
return $this;
}
public function removeEstudio(Estudio $estudio): self
{
if ($this->estudios->removeElement($estudio)) {
// set the owning side to null (unless already changed)
if ($estudio->getProcedimiento() === $this) {
$estudio->setProcedimiento(null);
}
}
return $this;
}
/**
* @return Collection|OrdenProcedimiento[]
*/
public function getOrdenProcedimientos(): Collection
{
return $this->ordenProcedimientos;
}
public function addOrdenProcedimiento(OrdenProcedimiento $ordenProcedimiento): self
{
if (!$this->ordenProcedimientos->contains($ordenProcedimiento)) {
$this->ordenProcedimientos[] = $ordenProcedimiento;
$ordenProcedimiento->setProcedimiento($this);
}
return $this;
}
public function removeOrdenProcedimiento(OrdenProcedimiento $ordenProcedimiento): self
{
if ($this->ordenProcedimientos->removeElement($ordenProcedimiento)) {
// set the owning side to null (unless already changed)
if ($ordenProcedimiento->getProcedimiento() === $this) {
$ordenProcedimiento->setProcedimiento(null);
}
}
return $this;
}
/**
* @return Collection|OdontogramaProcedimiento[]
*/
public function getOdontogramaProcedimientos(): Collection
{
return $this->odontogramaProcedimientos;
}
public function addOdontogramaProcedimiento(OdontogramaProcedimiento $odontogramaProcedimiento): self
{
if (!$this->odontogramaProcedimientos->contains($odontogramaProcedimiento)) {
$this->odontogramaProcedimientos[] = $odontogramaProcedimiento;
$odontogramaProcedimiento->setProcedimiento($this);
}
return $this;
}
public function removeOdontogramaProcedimiento(OdontogramaProcedimiento $odontogramaProcedimiento): self
{
if ($this->odontogramaProcedimientos->removeElement($odontogramaProcedimiento)) {
// set the owning side to null (unless already changed)
if ($odontogramaProcedimiento->getProcedimiento() === $this) {
$odontogramaProcedimiento->setProcedimiento(null);
}
}
return $this;
}
public function getImagen(): ?string
{
return $this->imagen;
}
public function setImagen(?string $imagen): self
{
$this->imagen = $imagen;
return $this;
}
public function getProducto(): ?Producto
{
return $this->producto;
}
public function setProducto(?Producto $producto): self
{
$this->producto = $producto;
return $this;
}
public function getEspecialidad(): ?Especialidad
{
return $this->especialidad;
}
public function setEspecialidad(?Especialidad $especialidad): self
{
$this->especialidad = $especialidad;
return $this;
}
public function getColorActivo(): ?string
{
return $this->colorActivo;
}
public function setColorActivo(?string $colorActivo): self
{
$this->colorActivo = $colorActivo;
return $this;
}
public function getColorInactivo(): ?string
{
return $this->colorInactivo;
}
public function setColorInactivo(?string $colorInactivo): self
{
$this->colorInactivo = $colorInactivo;
return $this;
}
}